added abstraction for html parsing and response handling
This commit is contained in:
parent
11aa11903e
commit
2a4e32a274
4 changed files with 45 additions and 10 deletions
23
includes/request_parser.hpp
Normal file
23
includes/request_parser.hpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef REQUEST_PARSER_HPP
|
||||
#define REQUEST_PARSER_HPP
|
||||
|
||||
#include <istream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct HttpRequest {
|
||||
string method;
|
||||
string uri;
|
||||
string version;
|
||||
map<string, string> headers;
|
||||
string body;
|
||||
};
|
||||
|
||||
class request_parser {
|
||||
public:
|
||||
HttpRequest& parse(istream& data_stream);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in a new issue