title: How can I convert a Beast Boost http request to a string
body: <p>I did a web server with Beast Boost C++, and I want to convert a <code>boost::beast::http::request</code> into a simple <code>string</code></p>
  
  <p>I tried to print the request in the console by doing</p>
  
  <pre><code>std::cout &lt;&lt; req &lt;&lt; std::endl;
  </code></pre>
  
  <p>and it worked. But I can't find any function in the documentation to get the entire request as a string.</p>
  
  <p>I also tried to use a <code>std::ostringstream</code> by doing this:</p>
  
  <pre><code>std::ostringstream oss;
  oss &lt;&lt; req;
  std::string request_as_string = oss.str();
  </code></pre>
  
  <p>but I got the exception : <code>Microsoft C++ : std::out_of_range</code></p>