-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttprequest.h
More file actions
44 lines (39 loc) · 955 Bytes
/
httprequest.h
File metadata and controls
44 lines (39 loc) · 955 Bytes
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 HTTPREQUEST_H
#define HTTPREQUEST_H 1
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include "myutill.h"
using namespace std;
class HttpRequest{
/*enum _method{
GET,HEAD, POST,//in HTTP 1.0
PUT, DELETE, CONNECT, OPTIONS, TRACE//HTTP 1.1
}*/
//_method method;
//enum is not convenient
string body;
string method;
string path;
string version;
map<string, string> headers;
map<string, string> args;
bool keep_alive;
int parse_headers(string &);
int parse_basic(string &);
int parse_args(string &);
int parse_path(string &);
public:
bool ok;
HttpRequest(string &);
~HttpRequest();
const string & getmethod();
const string & getpath();
const string & getversion();
const map<string, string> & getheaders();
const map<string, string> & getargs();
const bool is_alive();;
const string & getbody();
};
#endif