perform a post request
| 100 | |
| 101 | // perform a post request |
| 102 | void do_post(beast::tcp_stream & stream, |
| 103 | http::request<http::string_body> & req, |
| 104 | beast::flat_buffer buffer, |
| 105 | http::response<http::dynamic_body> & res) |
| 106 | { |
| 107 | req.target("/post"); |
| 108 | req.method(beast::http::verb::post); |
| 109 | req.body() = "Some random post data"; |
| 110 | req.prepare_payload(); // set content-length based on the body |
| 111 | http::write(stream, req); |
| 112 | http::read(stream, buffer, res); |
| 113 | } |
| 114 | |
| 115 | |
| 116 | // perform a delete request |