Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
http::message::prepare_payload

Prepare the message payload fields for the body.

Synopsis
void
prepare_payload();
Description

This function will adjust the Content-Length and Transfer-Encoding field values based on the properties of the body.

Example
request<string_body> req{[link beast.ref.boost__beast__http__verb `verb::post`], "/" };
req.set([link beast.ref.boost__beast__http__field `field::user_agent`], "Beast" );
req.body() = "Hello, world!" ;
req.prepare_payload();

PrevUpHomeNext