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

Function do_delete

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

perform a delete request

Source from the content-addressed store, hash-verified

115
116// perform a delete request
117void do_delete(beast::tcp_stream & stream,
118 http::request<http::string_body> & req,
119 beast::flat_buffer buffer,
120 http::response<http::dynamic_body> & res)
121{
122 req.target("/delete");
123 req.method(beast::http::verb::delete_);
124 // NOTE: delete doesn't require a body
125 req.body() = "Some random delete data";
126 req.prepare_payload(); // set content-length based on the body
127 http::write(stream, req);
128 http::read(stream, buffer, res);
129}
130
131
132// Performs an HTTP request against httpbin.cpp.al and prints request & response

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