Prints the response headers
| 4 | |
| 5 | // Prints the response headers |
| 6 | void printResponseHeaders( Http::Response& response ) { |
| 7 | Http::Response::FieldTable headers = response.getHeaders(); |
| 8 | |
| 9 | std::cout << "Response:" << std::endl; |
| 10 | std::cout << "HTTP/" << response.getMajorHttpVersion() << "." << response.getMinorHttpVersion() |
| 11 | << " " << response.getStatus() << " " |
| 12 | << Http::Response::statusToString( response.getStatus() ) << std::endl; |
| 13 | |
| 14 | for ( auto&& head : headers ) { |
| 15 | std::cout << head.first << ": " << head.second << std::endl; |
| 16 | } |
| 17 | |
| 18 | std::cout << std::endl; |
| 19 | } |
| 20 | |
| 21 | EE_MAIN_FUNC int main( int argc, char* argv[] ) { |
| 22 | args::ArgumentParser parser( "HTTP request program example" ); |
no test coverage detected