|
| message ()=default |
| Constructor. More...
|
|
| message (message &&)=default |
| Constructor. More...
|
|
| message (message const &)=default |
| Constructor. More...
|
|
message & | operator= (message &&)=default |
| Assignment. More...
|
|
message & | operator= (message const &)=default |
| Assignment. More...
|
|
template<class... BodyArgs> |
| message (header_type &&h, BodyArgs &&...body_args) |
|
template<class... BodyArgs> |
| message (header_type const &h, BodyArgs &&...body_args) |
|
template<class Version , class = typename std::enable_if<isRequest && std::is_convertible<Version, unsigned>::value>::type> |
| message (verb method, string_view target, Version version) |
|
template<class Version , class BodyArg , class = typename std::enable_if<isRequest && std::is_convertible<Version, unsigned>::value>::type> |
| message (verb method, string_view target, Version version, BodyArg &&body_arg) |
|
template<class Version , class BodyArg , class FieldsArg , class = typename std::enable_if<isRequest && std::is_convertible<Version, unsigned>::value>::type> |
| message (verb method, string_view target, Version version, BodyArg &&body_arg, FieldsArg &&fields_arg) |
|
template<class Version , class = typename std::enable_if<! isRequest && std::is_convertible<Version, unsigned>::value>::type> |
| message (status result, Version version) |
|
template<class Version , class BodyArg , class = typename std::enable_if<! isRequest && std::is_convertible<Version, unsigned>::value>::type> |
| message (status result, Version version, BodyArg &&body_arg) |
|
template<class Version , class BodyArg , class FieldsArg , class = typename std::enable_if<! isRequest && std::is_convertible<Version, unsigned>::value>::type> |
| message (status result, Version version, BodyArg &&body_arg, FieldsArg &&fields_arg) |
|
| message (std::piecewise_construct_t) |
|
template<class... BodyArgs> |
| message (std::piecewise_construct_t, std::tuple< BodyArgs... > body_args) |
|
template<class... BodyArgs, class... FieldsArgs> |
| message (std::piecewise_construct_t, std::tuple< BodyArgs... > body_args, std::tuple< FieldsArgs... > fields_args) |
|
header_type const & | base () const |
| Returns the header portion of the message. More...
|
|
header_type & | base () |
| Returns the header portion of the message. More...
|
|
bool | chunked () const |
| Returns true if the chunked Transfer-Encoding is specified. More...
|
|
void | chunked (bool value) |
|
void | content_length (boost::optional< std::uint64_t > const &value) |
|
bool | keep_alive () const |
|
void | keep_alive (bool value) |
|
boost::optional< std::uint64_t > | payload_size () const |
|
void | prepare_payload () |
|
template<bool isRequest, class Body, class Fields = fields>
struct boost::beast::http::message< isRequest, Body, Fields >
A container for a complete HTTP message.
This container is derived from the Fields
template type. To understand all of the members of this class it is necessary to view the declaration for the Fields
type. When using the default fields container, those declarations are in fields.
A message can be a request or response, depending on the isRequest
template argument value. Requests and responses have different types; functions may be overloaded based on the type if desired.
The Body
template argument type determines the model used to read or write the content body of the message.
Newly constructed messages objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to status::ok.
- Template Parameters
-
isRequest | true if this represents a request, or false if this represents a response. Some class data members are conditionally present depending on this value. |
Body | A type meeting the requirements of Body. |
Fields | The type of container used to hold the field value pairs. |
template<bool isRequest, class Body , class Fields >
Set or clear the chunked Transfer-Encoding
This function will set or removed the "chunked" transfer encoding as the last item in the list of encodings in the field.
If the result of removing the chunked token results in an empty string, the field is erased.
The Content-Length field is erased unconditionally.
template<bool isRequest, class Body , class Fields >
Set or clear the Content-Length field
This function adjusts the Content-Length field as follows:
- If
value
specifies a value, the Content-Length field is set to the value. Otherwise
- The Content-Length field is erased.
If "chunked" token appears as the last item in the Transfer-Encoding field it is unconditionally removed.
- Parameters
-
value | The value to set for Content-Length. |
template<bool isRequest, class Body, class Fields = fields>
Returns true
if the message semantics indicate keep-alive
The value depends on the version in the message, which must be set to the final value before this function is called or else the return value is unreliable.
template<bool isRequest, class Body, class Fields = fields>
Set the keep-alive message semantic option
This function adjusts the Connection field to indicate whether or not the connection should be kept open after the corresponding response. The result depends on the version set on the message, which must be set to the final value before making this call.
- Parameters
-
value | true if the connection should persist. |
template<bool isRequest, class Body , class Fields >
Returns the payload size of the body in octets if possible.
This function invokes the Body algorithm to measure the number of octets in the serialized body container. If there is no body, this will return zero. Otherwise, if the body exists but is not known ahead of time, boost::none
is returned (usually indicating that a chunked Transfer-Encoding will be used).
- Note
- The value of the Content-Length field in the message is not inspected.