en	HTTP

en	Higher level functions such as Basic

en	This library offers programmers simple and performant models of HTTP messages and their associated operations including synchronous, asynchronous, and buffer-oriented parsing and serialization of messages in the HTTP/1 wire format using __Asio__. Specifically, the library provides:

en	Stream Reading

en	The functions [link beast.ref.boost__beast__http__read `read`], [link beast.ref.boost__beast__http__read_header `read_header`], [link beast.ref.boost__beast__http__read_some `read_some`], [link beast.ref.boost__beast__http__async_read `async_read`], [link beast.ref.boost__beast__http__async_read_header `async_read_header`], and [link beast.ref.boost__beast__http__async_read_some `async_read_some`] read HTTP/1 message data from a [link beast.concepts.streams stream].

en	Stream Writing

en	The functions [link beast.ref.boost__beast__http__write `write`], [link beast.ref.boost__beast__http__write_header `write_header`], [link beast.ref.boost__beast__http__write_some `write_some`], [link beast.ref.boost__beast__http__async_write `async_write`], [link beast.ref.boost__beast__http__async_write_header `async_write_header`], and [link beast.ref.boost__beast__http__async_write_some `async_write_some`] write HTTP/1 message data to a [link beast.concepts.streams stream].

en	Serialization

en	The __serializer__ produces a series of octet buffers conforming to the __rfc7230__ wire representation of a __message__.

en	Parsing

en	The __parser__ attempts to convert a series of octet buffers into a __message__.

en	Interfaces for operating on HTTP messages are structured into several layers. The highest level provides ease of use, while lower levels provide progressively more control, options, and flexibility. At the lowest level customization points are provided, where user defined types can replace parts of the implementation. The layers are arranged thusly:

en	[*6]

en	__message__

en	At the highest level, these free functions send or receive a complete HTTP message in one call. They are designed for ease of use: [link beast.ref.boost__beast__http__read.overload4 `read`], [link beast.ref.boost__beast__http__write.overload4 `write`], [link beast.ref.boost__beast__http__async_read.overload2 `async_read`], and [link beast.ref.boost__beast__http__async_write.overload2 `async_write`].

en	[*5]

en	__parser__, __serializer__

en	For more control, callers may take responsibility for managing the required __parser__ or __serializer__ transient state objects. This allows additional configuration such as limiting the number of bytes for message components during parsing, or regulating the size of buffers emitted during output. These functions send or receive complete messages using a serializer or parser: [link beast.ref.boost__beast__http__read.overload2 `read`], [link beast.ref.boost__beast__http__write.overload2 `write`], [link beast.ref.boost__beast__http__async_read.overload1 `async_read`], and [link beast.ref.boost__beast__http__async_write.overload1 `async_write`].

en	[*4]

en	__header__

en	Sometimes it is necessary to first send or receive the HTTP header. For example, to read the header and take action before continuing to read the body. These functions use a __parser__ or __serializer__ to read or write the header: [link beast.ref.boost__beast__http__read_header.overload2 `read_header`], [link beast.ref.boost__beast__http__write_header.overload2 `write_header`], [link beast.ref.boost__beast__http__async_read_header `async_read_header`], and [link beast.ref.boost__beast__http__async_write_header `async_write_header`].

en	[*3]

en	partial __message__

en	All of the stream operations at higher levels thus far have operated on a complete header or message. At this level it is possible to send and receive messages incrementally. This allows resource constrained implementations to perform work bounded on storage, or allows better control when setting timeouts for example. These functions read or write bounded amounts of data and return the number of bytes transacted: [link beast.ref.boost__beast__http__read_some.overload2 `read_some`], [link beast.ref.boost__beast__http__write_some.overload2 `write_some`], [link beast.ref.boost__beast__http__async_read_some `async_read_some`], and [link beast.ref.boost__beast__http__async_write_some `async_write_some`].

en	[*2]

en	[@https://tools.ietf.org/html/rfc7230#section-4.1 ['chunked-body]]

en	Until now parse and serialize operations apply or remove the chunked transfer coding as needed for message payloads whose size is not known ahead of time. For some domain specific niches, it is necessary to assume direct control over incoming or outgoing chunks in a chunk encoded message payload. For parsing this is achieved by setting hooks using the functions [link beast.ref.boost__beast__http__parser.on_chunk_header `on_chunk_header`] and/or [link beast.ref.boost__beast__http__parser.on_chunk_body `on_chunk_body`]. For serializing callers may first emit the header, and then use these buffer sequence adapters to control the contents of each chunk including [@https://tools.ietf.org/html/rfc7230#section-4.1.1 ['chunk extensions]] and the [@https://tools.ietf.org/html/rfc7230#section-4.1.2 ['trailer-part]]: [link beast.ref.boost__beast__http__chunk_body `chunk_body`], [link beast.ref.boost__beast__http__chunk_crlf `chunk_crlf`], [link beast.ref.boost__beast__http__chunk_header `chunk_header`], and [link beast.ref.boost__beast__http__chunk_last `chunk_last`].

en	[*1]

en	buffers

en	For ultimate control, the use of library stream algorithms may be bypassed entirely and instead work directly with buffers by calling members of __parser__ or __serializer__.

en	[*0]

en	['user-defined]

en	In addition to the typical customization points of __Stream__ and __DynamicBuffer__, user-defined types may replace parts of the library implementation at the lowest level. The customization points include __Fields__ for creating a container to store HTTP fields, __Body__ for defining containers and algorithms used for HTTP message payloads, and user-defined subclasses of __basic_parser__ for implementing custom message representation strategies.

en	This documentation assumes some familiarity with __Asio__ and