en	Serializer Stream Operations

en	Non-trivial algorithms need to do more than send entire messages at once, such as:

en	* Send the header first, and the body later.

en	* Send a message incrementally: bounded work in each I/O cycle.

en	* Use a series of caller-provided buffers to represent the body.

en	These tasks may be performed by using the serializer stream interfaces. To use these interfaces, first construct an appropriate serializer from the message to be sent:

en	Serializer

en	Name

en	Description

en	__serializer__

en	/// Provides buffer oriented HTTP message serialization functionality. template< bool isRequest, class Body, class Fields = fields > class serializer;

en	[link beast.ref.boost__beast__http__request_serializer `request_serializer`]

en	/// A serializer for HTTP/1 requests template< class Body, class Fields = fields > using request_serializer = serializer<true, Body, Fields>;

en	[link beast.ref.boost__beast__http__response_serializer `response_serializer`]

en	/// A serializer for HTTP/1 responses template< class Body, class Fields = fields > using response_serializer = serializer<false, Body, Fields>;

en	The choices for template types must match the message passed on construction. This code creates an HTTP response and the corresponding serializer:

en	The stream operations which work on serializers are:

en	Serializer Stream Operations

en	Name

en	Description

en	[link beast.ref.boost__beast__http__write.overload1 [*write]]

en	Send everything in a __serializer__ to a __SyncWriteStream__.

en	[link beast.ref.boost__beast__http__async_write.overload1 [*async_write]]

en	Send everything in a __serializer__ asynchronously to an __AsyncWriteStream__.

en	[link beast.ref.boost__beast__http__write_header.overload1 [*write_header]]

en	Send only the header from a __serializer__ to a __SyncWriteStream__.

en	[link beast.ref.boost__beast__http__async_write_header [*async_write_header]]

en	Send only the header from a __serializer__ asynchronously to an __AsyncWriteStream__.

en	[link beast.ref.boost__beast__http__write_some.overload1 [*write_some]]

en	Send part of a __serializer__ to a __SyncWriteStream__.

en	[link beast.ref.boost__beast__http__async_write_some [*async_write_some]]

en	Send part of a __serializer__ asynchronously to an __AsyncWriteStream__.

en	Here is an example of using a serializer to send a message on a stream synchronously. This performs the same operation as calling `write(stream, m)`: