| 335 | |
| 336 | template<class SyncReadStream> |
| 337 | void |
| 338 | print_response(SyncReadStream& stream) |
| 339 | { |
| 340 | static_assert(is_sync_read_stream<SyncReadStream>::value, |
| 341 | "SyncReadStream type requirements not met"); |
| 342 | |
| 343 | // Declare a parser for an HTTP response |
| 344 | response_parser<string_body> parser; |
| 345 | |
| 346 | // Read the entire message |
| 347 | read(stream, parser); |
| 348 | |
| 349 | // Now print the message |
| 350 | std::cout << parser.get() << std::endl; |
| 351 | } |
| 352 | |
| 353 | //] |
| 354 |