Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

http::serializer

Provides buffer oriented HTTP message serialization functionality.

Synopsis

Defined in header <boost/beast/http/serializer.hpp>

template<
    bool isRequest,
    class Body,
    class Fields = fields>
class serializer
Types

Name

Description

value_type

The type of message this serializer uses.

Member Functions

Name

Description

consume

Consume buffer octets in the serialization.

get

Returns the message being serialized.

is_done

Return true if serialization is complete.

is_header_done

Return true if serialization of the header is complete.

limit

Returns the serialized buffer size limit.

Set the serialized buffer size limit.

next

Returns the next set of buffers in the serialization.

operator=

Assignment.

serializer

Constructor.

split

Returns true if we will pause after writing the complete header.

Set whether the header and body are written separately.

writer_impl

Provides low-level access to the associated BodyWriter.

Description

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 http::chunk_body, http::chunk_crlf, http::chunk_header, and http::chunk_last.

Template Parameters

Type

Description

isRequest

true if the message is a request.

Body

The body type of the message.

Fields

The type of fields in the message.

Convenience header <boost/beast/http.hpp>


PrevUpHomeNext