MCPcopy Create free account
hub / github.com/boostorg/beast / do_put

Function do_put

example/http/client/methods/http_client_methods.cpp:88–99  ·  view source on GitHub ↗

perform a put request

Source from the content-addressed store, hash-verified

86
87// perform a put request
88void do_put(beast::tcp_stream & stream,
89 http::request<http::string_body> & req,
90 beast::flat_buffer buffer,
91 http::response<http::dynamic_body> & res)
92{
93 req.target("/put");
94 req.method(beast::http::verb::put);
95 req.body() = "Some random put data";
96 req.prepare_payload(); // set content-length based on the body
97 http::write(stream, req);
98 http::read(stream, buffer, res);
99}
100
101// perform a post request
102void do_post(beast::tcp_stream & stream,

Callers 1

mainFunction · 0.85

Calls 5

targetMethod · 0.80
methodMethod · 0.80
bodyMethod · 0.80
writeFunction · 0.50
readFunction · 0.50

Tested by

no test coverage detected