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 ( std::vector<uint8_t>::const_iterator lIt = aHttpResponse.
content.begin() ; lIt != aHttpResponse.
content.end() ; ++lIt )
52 aStr << char ( *lIt );
90 HttpResponseGrammar::HttpResponseGrammar() :
91 HttpResponseGrammar::base_type ( response )
93 using namespace boost::spirit;
94 response = + ( qi::char_ - qi::lit (
"/" ) ) >> qi::lit (
"/" ) >> double_ >> int_ >> nonewline_sequence >> noblankline_sequence >> qi::lexeme[ * ( qi::char_ ) ] ;
95 nospace_sequence = qi::lexeme[ + ( qi::char_ -
" " ) >
" " ];
96 nonewline_sequence = qi::lexeme[ + ( qi::char_ -
"\r\n" ) >> -qi::lit (
"\r\n" ) ];
97 noblankline_sequence = qi::lexeme[ + ( qi::char_ -
"\r\n\r\n" ) >> -qi::lit (
"\r\n\r\n" ) ];
int status
the response status
std::string method
the http transport method
std::string headers
parsed headers
double version
the http version number
Struct to store an http response received from a server when parsed by boost spirit.
std::string status_string
the response status string
The log_inserter function to add an HttpResponseType object to a log entry.
std::vector< uint8_t > content
parsed message content
std::ostream & operator<<(std::ostream &aStr, const uhal::HttpResponseType &aHttpResponse)