...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Provides buffer oriented HTTP message serialization functionality.
Defined in header <boost/beast/http/serializer.hpp>
template< bool isRequest, class Body, class Fields = fields> class serializer
Name |
Description |
---|---|
The type of message this serializer uses. |
Name |
Description |
---|---|
Consume buffer octets in the serialization. |
|
Returns the message being serialized. |
|
Return |
|
Return |
|
Returns the serialized buffer size limit. |
|
Returns the next set of buffers in the serialization. |
|
Assignment. |
|
serializer [constructor] |
Move Constructor. |
Returns |
|
Provides low-level access to the associated BodyWriter |
An object of this type is used to serialize a complete HTTP message into a sequence of octets. To use this class, construct an instance with the message to be serialized. The implementation will automatically perform chunk encoding if the contents of the message indicate that chunk encoding is required.
Chunked output produced by the serializer never contains chunk extensions
or trailers, and the location of chunk boundaries is not specified. If callers
require chunk extensions, trailers, or control over the exact contents of
each chunk they should use the serializer to write just the message header,
and then assume control over serializing the chunked payload by using the
chunk buffer sequence types chunk_body
, chunk_crlf
, chunk_header
, and chunk_last
.
Moving or copying the serializer after the first call to serializer::next
results in undefined behavior.
Try to heap-allocate the serializer object if you need to move the serializer
between multiple async operations (for example, between a call to async_write_header
and async_write
).
Type |
Description |
---|---|
|
|
|
The body type of the message. |
|
The type of fields in the message. |