title: boost beast message with body_limit
body: <p>My starting point is to create a simple downloader code from the boost beast http_client_async example at <a href="https://www.boost.org/doc/libs/1_67_0/libs/beast/example/http/client/async/http_client_async.cpp" rel="noreferrer">boost http_client_async</a>. In this scenario i want to write the received body into a file. </p>
  
  <p>So I exchanged the string body into a file_body, to write the received data:</p>
  
  <pre><code> http::response_parser&lt;http::file_body&gt; res_;
  </code></pre>
  
  <p>And simply rewrote the on_write method to</p>
  
  <pre><code>void on_write( boost::system::error_code ec,
                 std::size_t bytes_transferred )
  {
      boost::ignore_unused(bytes_transferred);
  
      if(ec)
          return fail(ec, "write");
  
      boost::system::error_code ec_file;
      res_.body().open("myTest.txt", boost::beast::file_mode::write, ec_file);
  
      // test for ec_file missing 
  
      // Receive the HTTP response
      http::async_read(socket_, buffer_, res_,
          std::bind(
              &amp;session::on_read,
              shared_from_this(),
              std::placeholders::_1,
              std::placeholders::_2));
  }
  </code></pre>
  
  <p>So but now, some of the received data bodies are to big:</p>
  
  <pre><code>read: body limit exceeded
  </code></pre>
  
  <p>and I try to increase the body limit. </p>
  
  <p>In case of using a <strong>parser</strong> instead of a <strong>message</strong>, the size limit of the requested body can be changed with the <code>body_limit()</code> method. </p>
  
  <p>Is there an easy way to increase the body size limit from a <strong>message</strong> as well?</p>