...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The type of message returned by the parser.
using value_type = message< isRequest, Body, basic_fields< Allocator > >;
Name |
Description |
---|---|
The type providing the body traits. |
|
The type representing the fields. |
|
The base class used to hold the header portion of the message. |
|
Indicates if the header is a request or response. |
Name |
Description |
---|---|
Returns the header portion of the message. |
|
Returns the body. |
|
Returns |
|
Set or clear the Content-Length field. |
|
Returns |
|
Returns |
|
Constructor. |
|
Return the request-method verb. |
|
Return the request-method as a string. |
|
Returns |
|
Assignment. |
|
Returns the payload size of the body in octets if possible. |
|
Prepare the message payload fields for the body. |
|
Return the response reason-phrase. |
|
The response status-code result. |
|
The response status-code expressed as an integer. |
|
Returns the request-target string. |
|
Return the HTTP-version. |
This container is derived from the Fields
template type. To understand all of the members of this class it is necessary
to view the declaration for the Fields
type. When using the default fields container, those declarations are in
fields
.
A message can be a request or response, depending on the isRequest
template argument value. Requests
and responses have different types; functions may be overloaded based on
the type if desired. The Body
template argument type determines the model used to read or write the content
body of the message. Newly constructed messages objects have version set
to HTTP/1.1. Newly constructed response objects also have result code set
to status::ok
.
Type |
Description |
---|---|
|
|
|
A type meeting the requirements of Body. |
|
The type of container used to hold the field value pairs. |
Name |
Description |
---|---|
The type of allocator used. |
|
A constant iterator to the field sequence. |
|
A constant iterator to the field sequence. |
|
A strictly less predicate for comparing keys, using a case-insensitive comparison. |
|
The type of element used to represent a field. |
|
The algorithm used to serialize the header. |
Name |
Description |
---|---|
Returns the value for a field, or throws an exception. |
|
Constructor. |
|
Return a const iterator to the beginning of the field sequence. |
|
Return a const iterator to the beginning of the field sequence. |
|
Return a const iterator to the end of the field sequence. |
|
Remove all fields from the container. |
|
Return the number of fields with the specified name. |
|
Return a const iterator to the end of the field sequence. |
|
Returns a range of iterators to the fields with the specified name. |
|
Remove a field. |
|
Returns an iterator to the case-insensitive matching field. |
|
Return a copy of the allocator associated with the container. |
|
Insert a field. |
|
Returns a copy of the key comparison function. |
|
Move assignment. |
|
Returns the value for a field, or |
|
Set a field value, removing any other instances of that field.
|
|
Return a buffer sequence representing the trailers. |
|
~basic_fields [destructor] |
Destructor. |
Name |
Description |
---|---|
Returns the chunked Transfer-Encoding setting. |
|
Returns the keep-alive setting. |
|
Returns the request-method string. |
|
Returns the response reason-phrase string. |
|
Returns the request-target string. |
|
Returns |
|
Adjusts the chunked Transfer-Encoding value. |
|
Sets or clears the Content-Length field. |
|
Adjusts the Connection field. |
|
Set or clear the method string. |
|
Set or clear the reason string. |
|
Set or clear the target string. |
Name |
Description |
---|---|
Swap two field containers. |
This container is designed to store the field value pairs that make up
the fields and trailers in an HTTP message. Objects of this type are iterable,
with each element holding the field name and field value. Field names are
stored as-is, but comparisons are case-insensitive. The container behaves
as a std::multiset
; there will be a separate value
for each occurrence of the same field name. When the container is iterated
the fields are presented in the order of insertion, with fields having
the same name following each other consecutively. Meets the requirements
of Fields
Type |
Description |
---|---|
|
The allocator to use. |