...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A chunk header.
Defined in header <boost/beast/http/chunk_encode.hpp>
class chunk_header
Name |
Description |
---|---|
Required for ConstBufferSequence. |
|
Required for ConstBufferSequence. |
Name |
Description |
---|---|
Required for ConstBufferSequence. |
|
Constructor. Required for ConstBufferSequence. |
|
Required for ConstBufferSequence. |
This implements a ConstBufferSequence representing the header of a chunk. The serialized format is as follows:
chunk-header = 1*HEXDIG chunk-ext CRLF chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) chunk-ext-name = token chunk-ext-val = token / quoted-string
The chunk extension is optional. After the header and chunk body have been
serialized, it is the callers responsibility to also serialize the final
CRLF ("\\r\\n"
).
This class allows the caller to emit piecewise chunk bodies, by first serializing the chunk header using this class and then serializing the chunk body in a series of one or more calls to a stream write operation.
To use this class, pass an instance of it to a stream algorithm as the buffer sequence:
// writes "400;x\r\n" boost::asio::write(stream, chunk_header{1024, "x"});
https://tools.ietf.org/html/rfc7230#section-4.1
Convenience header <boost/beast/http.hpp>