23 #ifndef HTTP_PARSER_HPP 24 #define HTTP_PARSER_HPP 45 const char http_content_type[24] = R
"END(^(.*?);\s(.*)$)END"; 46 regex content_type_regex{http_content_type, regex_constants::optimize}; 48 const string file_regex_line1 = R
"END(Content-Disposition: form-data; name="(.*?)"; filename="(.*?)")END"; 49 regex multipart_form_file_l1{file_regex_line1, regex_constants::optimize}; 51 const string file_regex_line2 = R
"END(Content-Type: (.*))END"; 52 regex multipart_form_file_l2{file_regex_line2, regex_constants::optimize}; 54 const string data_regex = R
"END(Content-Disposition: form-data; name="(.*)")END"; 55 regex multipart_form_data{data_regex, regex_constants::optimize}; 62 const string cr_nl{
"\r\n"};
63 const string cr_nl_2{
"\r\n\r\n"};
64 static const int cr_nl_s = 2;
65 static const int cr_nl_2s = 4;
67 map<string, vector<string>>
get;
68 map<string, vector<string>>
post;
69 map<string, vector<map<string, string>>>
file;
75 map<string, string>
env;
76 void parse_raw_content_type();
77 void parse_query_string();
79 void parse_multipart_form();
81 void print_file(ostream &o_stream,
bool hex_dump =
false);
82 void print_get(ostream &o_stream,
bool hex_dump =
false);
83 void print_post(ostream &o_stream,
bool hex_dump =
false);
88 #endif //HTTP_PARSER_HPP void * curl
Definition: http_parser.hpp:73
string content_type
Definition: http_parser.hpp:60
string_util su
Definition: http_parser.hpp:74
map< string, vector< map< string, string > > > file
Definition: http_parser.hpp:69
map< string, vector< string > > post
Definition: http_parser.hpp:68
Definition: http_parser.hpp:42
string boundary
Definition: http_parser.hpp:58
map< string, string > env
Definition: http_parser.hpp:75
Definition: http_io.hpp:19
Definition: string_util.hpp:31
string charset
Definition: http_parser.hpp:59
Definition: hex_dump.hpp:28