1

The examples of reading the response that I've seen look something like the following. But this prints out the response header as well as the response body. Does Beast expose a way to get just the body as a string? I t looks like it is possible to access res.body but I'm not sure exactly how to take that and convert it.

// Declare a container to hold the response
http::response<http::dynamic_body> res;

// Receive the HTTP response
http::read(socket, buffer, res);

// Write the message to standard out
std::cout << res << std::endl;
user782220
  • 10,677
  • 21
  • 72
  • 135

1 Answers1

1

Use htpp::string_body instead of http::dynamic_body and then get res.body

Slava Zhuyko
  • 691
  • 4
  • 12