-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrequest.hpp
44 lines (37 loc) · 914 Bytes
/
request.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef REQUEST_HPP
#define REQUEST_HPP
#include <string>
#include <map>
#include <map>
#include "server.hpp"
#include "config/conf.hpp"
class request
{
private:
std::string method;
std::string path;
std::string version;
std::string query;
std::multimap<std::string, std::string> headers;
//std::vector<std::pair<std::string, std::string> > headers;
std::string body;
public:
std::string rawReq;
request(const std::string &req);
~request();
void parse(Server &serv);
std::string getQuery();
std::string getMethod();
std::string getPath();
std::string getVersion();
std::multimap<std::string, std::string>& getHeader();
std::string getBody();
size_t parseHeaders(size_t start);
void urlDecoding();
void parseBody();
bool checkVerion();
bool checkPath();
bool checkMethod();
bool checkHeaders();
};
#endif