Add makefile and split request and response to header files

This commit is contained in:
Pablu23
2024-07-08 03:07:46 +02:00
parent a32934d4bc
commit 752cb229c3
6 changed files with 200 additions and 165 deletions

25
request.hpp Normal file
View File

@@ -0,0 +1,25 @@
#ifndef REQUEST_HEADER_H
#define REQUEST_HEADER_H
#include <map>
#include <sstream>
#include <string>
#include <vector>
class Request {
private:
std::map<std::string, std::string> m_headers;
std::string m_method;
std::string m_path;
std::vector<std::byte> m_payload;
std::string m_protocol;
private:
bool protocol(std::stringstream *ss, int *procPart, char c);
public:
Request(std::vector<std::byte> buf);
void Print();
bool HasData();
std::vector<std::byte> Data();
};
#endif // !REQUEST_HEADER_H