36#include <boost/spirit/include/qi.hpp>
43 aStr <<
" > method = " << aHttpResponse.
method <<
"\n";
44 aStr <<
" > version = " << aHttpResponse.
version <<
"\n";
45 aStr <<
" > status = " << aHttpResponse.
status <<
"\n";
46 aStr <<
" > status_string = " << aHttpResponse.
status_string <<
"\n";
47 aStr <<
" > NameValuePairs =\n" << aHttpResponse.
headers <<
"\n";
48 aStr <<
" > Content =\n";
50 for (
auto& x: aHttpResponse.
content )
67 HttpResponseGrammar::HttpResponseGrammar() :
68 HttpResponseGrammar::base_type ( response )
70 using namespace boost::spirit;
71 response = + ( qi::char_ - qi::lit (
"/" ) ) >> qi::lit (
"/" ) >> double_ >>
int_ >> nonewline_sequence >> noblankline_sequence >> qi::lexeme[ * ( qi::char_ ) ] ;
72 nospace_sequence = qi::lexeme[ + ( qi::char_ -
" " ) >
" " ];
73 nonewline_sequence = qi::lexeme[ + ( qi::char_ -
"\r\n" ) >> -qi::lit (
"\r\n" ) ];
74 noblankline_sequence = qi::lexeme[ + ( qi::char_ -
"\r\n\r\n" ) >> -qi::lit (
"\r\n\r\n" ) ];
std::ostream & operator<<(std::ostream &aStr, const uhal::HttpResponseType &aHttpResponse)
Struct to store an http response received from a server when parsed by boost spirit.
std::string status_string
the response status string
std::string method
the http transport method
std::string headers
parsed headers
int status
the response status
std::vector< uint8_t > content
parsed message content
double version
the http version number