First really working router Version

This commit is contained in:
Pablu23
2024-07-08 16:08:10 +02:00
parent 752cb229c3
commit 986be64e03
12 changed files with 424 additions and 73 deletions

View File

@@ -1,5 +1,7 @@
#ifndef REQUEST_HEADER_H
#define REQUEST_HEADER_H
#include "path.hpp"
#include <map>
#include <sstream>
#include <string>
@@ -9,7 +11,7 @@ class Request {
private:
std::map<std::string, std::string> m_headers;
std::string m_method;
std::string m_path;
std::string m_pathRaw;
std::vector<std::byte> m_payload;
std::string m_protocol;
@@ -17,7 +19,8 @@ private:
bool protocol(std::stringstream *ss, int *procPart, char c);
public:
Request(std::vector<std::byte> buf);
Path path;
explicit Request(std::vector<std::byte> buf);
void Print();
bool HasData();
std::vector<std::byte> Data();