Newer
Older
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
45
46
#ifndef _HTTP_REQUEST_HPP
#define _HTTP_REQUEST_HPP
#include <string>
#include <vector>
#include <unordered_map>
#include "http_header.hpp"
class HttpRequest
{
private:
std::string _ip;
int _port;
std::string _method;
std::string _uri;
std::string _httpver;
HttpHeaders _headers;
std::vector<std::string> _regexMatches;
public:
const std::string & ip() const;
int port() const;
const std::string & method() const;
const std::string & uri() const;
const std::string & httpver() const;
const HttpHeaders & headers() const;
const std::vector<std::string> & regexMatches() const;
friend class HttpServer;
friend bool parse_headers_into(const std::string &head_text, HttpRequest &req);
friend bool parse_requestline_into(const std::string &head_text, HttpRequest &req);
};
#endif // _HTTP_REQUEST_HPP