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