title: C++ Send data in body with Boost.asio and Beast library
body: <p>I've to use a C++ library for sending data to a REST-Webservice of our company.
  I start with Boost and <a href="http://vinniefalco.github.io/beast/index.html" rel="noreferrer">Beast</a> and with the example given <a href="https://stackoverflow.com/questions/5348344/http-client-library-for-c/37510388#37510388">here</a> under Code::Blocks in a Ubuntu 16.04 enviroment.
  The documentation doesn't helped me in following problem:</p>
  
  <p>My code is, more or less, equal to the example and I can compile and send a GET-request to my test webservice successfully.</p>
  
  <p>But how can I set data inside the request (req) from this definition:</p>
  
  <pre><code>:
  beast::http::request&lt;beast::http::string_body&gt; req;
  req.method("GET");
  req.target("/");
  :
  </code></pre>
  
  <p>I tried to use some <code>req.body.???</code>, but code completition doesn't give me a hint about functionality (btw. don't work). I know that <code>req.method</code> must be changed to "POST" to send data.</p>
  
  <p>Google doesn't show new example about this, only the above code is found as a example.</p>
  
  <p>Someone with a hint to a code example or using about the Beast (<em>roar</em>). Or should I use websockets? Or only boost::asio like answered <a href="https://stackoverflow.com/questions/17799229/boost-asio-post-http-request-headers-and-body">here</a>?</p>
  
  <p>Thanks in advance and excuse my bad english.</p>