Allow writing the http request body to a IO stream.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2018-04-02 17:13:39 -03:00
parent 46824f3af5
commit 10b0c64d75
3 changed files with 265 additions and 33 deletions

View File

@@ -50,6 +50,16 @@ EE_MAIN_FUNC int main (int argc, char * argv []) {
Http::Response::Status status = response.getStatus();
if ( status == Http::Response::Ok ) {
Http::Response::FieldTable headers = response.getHeaders();
std::cout << "Headers: " << std::endl;
for ( auto head = headers.begin(); head != headers.end(); ++head ) {
std::cout << "\t" << head->first << ": " << head->second << std::endl;
}
std::cout << std::endl << "Body: " << std::endl;
std::cout << response.getBody() << std::endl;
} else {
std::cout << "Error " << status << std::endl;