ゴミ箱
|
Namespaces | |
detail | |
Classes | |
class | basic_chunk_extensions |
struct | basic_dynamic_body |
class | basic_fields |
struct | basic_file_body |
class | basic_parser |
struct | basic_string_body |
struct | buffer_body |
class | chunk_body |
struct | chunk_crlf |
class | chunk_header |
class | chunk_last |
struct | empty_body |
class | ext_list |
struct | header |
struct | header< false, Fields > |
struct | header< true, Fields > |
struct | is_body_reader |
struct | is_body_writer |
struct | message |
class | param_list |
class | parser |
class | serializer |
struct | span_body |
class | token_list |
struct | vector_body |
Typedefs | |
using | chunk_extensions = basic_chunk_extensions< std::allocator< char >> |
A set of chunk extensions. More... | |
using | dynamic_body = basic_dynamic_body< multi_buffer > |
using | fields = basic_fields< std::allocator< char >> |
A typical HTTP header fields container. More... | |
using | file_body = basic_file_body< file > |
A message body represented by a file on the filesystem. More... | |
template<class Fields = fields> | |
using | request_header = header< true, Fields > |
A typical HTTP request header. More... | |
template<class Fields = fields> | |
using | response_header = header< false, Fields > |
A typical HTTP response header. More... | |
template<class Body , class Fields = fields> | |
using | request = message< true, Body, Fields > |
A typical HTTP request. More... | |
template<class Body , class Fields = fields> | |
using | response = message< false, Body, Fields > |
A typical HTTP response. More... | |
template<class Body , class Allocator = std::allocator<char>> | |
using | request_parser = parser< true, Body, Allocator > |
An HTTP/1 parser for producing a request message. More... | |
template<class Body , class Allocator = std::allocator<char>> | |
using | response_parser = parser< false, Body, Allocator > |
An HTTP/1 parser for producing a response message. More... | |
using | opt_token_list = detail::basic_parsed_list< detail::opt_token_list_policy > |
template<class Body , class Fields = fields> | |
using | request_serializer = serializer< true, Body, Fields > |
A serializer for HTTP/1 requests. More... | |
template<class Body , class Fields = fields> | |
using | response_serializer = serializer< false, Body, Fields > |
A serializer for HTTP/1 responses. More... | |
using | string_body = basic_string_body< char > |
A Body using std::string More... | |
template<class T > | |
using | is_body = detail::has_value_type< T > |
template<class T > | |
using | is_fields = typename detail::is_fields_helper< T >::type |
Functions | |
template<bool isRequest, class File , class Fields > | |
std::ostream & | operator<< (std::ostream &os, message< isRequest, basic_file_body< File >, Fields > const &msg)=delete |
template<bool isRequest, class Fields > | |
std::ostream & | operator<< (std::ostream &os, message< isRequest, buffer_body, Fields > const &msg)=delete |
template<class ConstBufferSequence , class... Args> | |
auto | make_chunk (ConstBufferSequence const &buffers, Args &&...args) -> chunk_body< ConstBufferSequence > |
chunk_last< chunk_crlf > | make_chunk_last () |
template<class Trailer , class... Args> | |
chunk_last< Trailer > | make_chunk_last (Trailer const &trailer, Args &&...args) |
string_view | to_string (field f) |
field | string_to_field (string_view s) |
std::ostream & | operator<< (std::ostream &os, field f) |
Write the text for a field name to an output stream. More... | |
error_code | make_error_code (error ev) |
template<class Allocator > | |
void | swap (basic_fields< Allocator > &lhs, basic_fields< Allocator > &rhs) |
template<class Fields > | |
void | swap (header< true, Fields > &h1, header< true, Fields > &h2) |
template<class Fields > | |
void | swap (header< false, Fields > &h1, header< false, Fields > &h2) |
template<bool isRequest, class Body , class Fields > | |
void | swap (message< isRequest, Body, Fields > &m1, message< isRequest, Body, Fields > &m2) |
template<class SyncReadStream , class DynamicBuffer , bool isRequest, class Derived > | |
std::size_t | read_some (SyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser) |
template<class SyncReadStream , class DynamicBuffer , bool isRequest, class Derived > | |
std::size_t | read_some (SyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser, error_code &ec) |
template<class AsyncReadStream , class DynamicBuffer , bool isRequest, class Derived , class ReadHandler > | |
async_return_type< ReadHandler, void(error_code, std::size_t)> | async_read_some (AsyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser, ReadHandler &&handler) |
template<class SyncReadStream , class DynamicBuffer , bool isRequest, class Derived > | |
std::size_t | read_header (SyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser) |
template<class SyncReadStream , class DynamicBuffer , bool isRequest, class Derived > | |
std::size_t | read_header (SyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser, error_code &ec) |
template<class AsyncReadStream , class DynamicBuffer , bool isRequest, class Derived , class ReadHandler > | |
async_return_type< ReadHandler, void(error_code, std::size_t)> | async_read_header (AsyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser, ReadHandler &&handler) |
template<class SyncReadStream , class DynamicBuffer , bool isRequest, class Derived > | |
std::size_t | read (SyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser) |
template<class SyncReadStream , class DynamicBuffer , bool isRequest, class Derived > | |
std::size_t | read (SyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser, error_code &ec) |
template<class AsyncReadStream , class DynamicBuffer , bool isRequest, class Derived , class ReadHandler > | |
async_return_type< ReadHandler, void(error_code, std::size_t)> | async_read (AsyncReadStream &stream, DynamicBuffer &buffer, basic_parser< isRequest, Derived > &parser, ReadHandler &&handler) |
template<class SyncReadStream , class DynamicBuffer , bool isRequest, class Body , class Allocator > | |
std::size_t | read (SyncReadStream &stream, DynamicBuffer &buffer, message< isRequest, Body, basic_fields< Allocator >> &msg) |
template<class SyncReadStream , class DynamicBuffer , bool isRequest, class Body , class Allocator > | |
std::size_t | read (SyncReadStream &stream, DynamicBuffer &buffer, message< isRequest, Body, basic_fields< Allocator >> &msg, error_code &ec) |
template<class AsyncReadStream , class DynamicBuffer , bool isRequest, class Body , class Allocator , class ReadHandler > | |
async_return_type< ReadHandler, void(error_code, std::size_t)> | async_read (AsyncReadStream &stream, DynamicBuffer &buffer, message< isRequest, Body, basic_fields< Allocator >> &msg, ReadHandler &&handler) |
template<class Policy > | |
bool | validate_list (detail::basic_parsed_list< Policy > const &list) |
status | int_to_status (unsigned v) |
status_class | to_status_class (unsigned v) |
status_class | to_status_class (status v) |
string_view | obsolete_reason (status v) |
std::ostream & | operator<< (std::ostream &, status) |
Outputs the standard reason phrase of a status code to a stream. More... | |
string_view | to_string (verb v) |
Returns the text representation of a request method verb. More... | |
verb | string_to_verb (string_view s) |
template<class SyncWriteStream , bool isRequest, class Body , class Fields > | |
std::size_t | write_some (SyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr) |
template<class SyncWriteStream , bool isRequest, class Body , class Fields > | |
std::size_t | write_some (SyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr, error_code &ec) |
template<class AsyncWriteStream , bool isRequest, class Body , class Fields , class WriteHandler > | |
async_return_type< WriteHandler, void(error_code, std::size_t)> | async_write_some (AsyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr, WriteHandler &&handler) |
template<class SyncWriteStream , bool isRequest, class Body , class Fields > | |
std::size_t | write_header (SyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr) |
template<class SyncWriteStream , bool isRequest, class Body , class Fields > | |
std::size_t | write_header (SyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr, error_code &ec) |
template<class AsyncWriteStream , bool isRequest, class Body , class Fields , class WriteHandler > | |
async_return_type< WriteHandler, void(error_code, std::size_t)> | async_write_header (AsyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr, WriteHandler &&handler) |
template<class SyncWriteStream , bool isRequest, class Body , class Fields > | |
std::size_t | write (SyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr) |
template<class SyncWriteStream , bool isRequest, class Body , class Fields > | |
std::size_t | write (SyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr, error_code &ec) |
template<class AsyncWriteStream , bool isRequest, class Body , class Fields , class WriteHandler > | |
async_return_type< WriteHandler, void(error_code, std::size_t)> | async_write (AsyncWriteStream &stream, serializer< isRequest, Body, Fields > &sr, WriteHandler &&handler) |
template<class SyncWriteStream , bool isRequest, class Body , class Fields > | |
std::size_t | write (SyncWriteStream &stream, message< isRequest, Body, Fields > const &msg) |
template<class SyncWriteStream , bool isRequest, class Body , class Fields > | |
std::size_t | write (SyncWriteStream &stream, message< isRequest, Body, Fields > const &msg, error_code &ec) |
template<class AsyncWriteStream , bool isRequest, class Body , class Fields , class WriteHandler > | |
async_return_type< WriteHandler, void(error_code, std::size_t)> | async_write (AsyncWriteStream &stream, message< isRequest, Body, Fields > &msg, WriteHandler &&handler) |
template<class Fields > | |
std::ostream & | operator<< (std::ostream &os, header< true, Fields > const &h) |
template<class Fields > | |
std::ostream & | operator<< (std::ostream &os, header< false, Fields > const &h) |
template<bool isRequest, class Body , class Fields > | |
std::ostream & | operator<< (std::ostream &os, message< isRequest, Body, Fields > const &msg) |
struct | std::declval< boost::optional< std::pair< typename T::reader::const_buffers_type, bool > > & > () |
struct | std::declval< std::size_t & > () |
struct | std::declval< typename T::writer & > ().finish(std |
std::ostream & | operator<< (std::ostream &os, verb v) |
Write the text for a request method verb to an output stream. More... | |
template<bool isRequest, class Fields > | |
std::ostream & | operator<< (std::ostream &os, header< isRequest, Fields > const &msg) |
using boost::beast::http::chunk_extensions = typedef basic_chunk_extensions<std::allocator<char>> |
A set of chunk extensions.
using boost::beast::http::dynamic_body = typedef basic_dynamic_body<multi_buffer> |
A dynamic message body represented by a multi_buffer
Meets the requirements of Body.
using boost::beast::http::fields = typedef basic_fields<std::allocator<char>> |
A typical HTTP header fields container.
using boost::beast::http::file_body = typedef basic_file_body<file> |
A message body represented by a file on the filesystem.
using boost::beast::http::is_body = typedef detail::has_value_type<T> |
Determine if T
meets the requirements of Body.
This metafunction is equivalent to std::true_type
if T
has a nested type named value_type
.
T | The body type to test. |
using boost::beast::http::is_fields = typedef typename detail::is_fields_helper<T>::type |
Determine if T
meets the requirements of Fields
T | The body type to test. |
Use with static_assert
:
Use with std::enable_if
(SFINAE):
using boost::beast::http::opt_token_list = typedef detail::basic_parsed_list< detail::opt_token_list_policy> |
A list of tokens in a comma separated HTTP field value.
This container allows iteration of a list of items in a header field value. The input is a comma separated list of tokens.
If a parsing error is encountered while iterating the string, the behavior of the container will be as if a string containing only characters up to but excluding the first invalid character was used to construct the list.
To use this class, construct with the string to be parsed and then use begin
and end
, or range-for to iterate each item:
using boost::beast::http::request = typedef message<true, Body, Fields> |
A typical HTTP request.
using boost::beast::http::request_header = typedef header<true, Fields> |
A typical HTTP request header.
using boost::beast::http::request_parser = typedef parser<true, Body, Allocator> |
An HTTP/1 parser for producing a request message.
using boost::beast::http::request_serializer = typedef serializer<true, Body, Fields> |
A serializer for HTTP/1 requests.
using boost::beast::http::response = typedef message<false, Body, Fields> |
A typical HTTP response.
using boost::beast::http::response_header = typedef header<false, Fields> |
A typical HTTP response header.
using boost::beast::http::response_parser = typedef parser<false, Body, Allocator> |
An HTTP/1 parser for producing a response message.
using boost::beast::http::response_serializer = typedef serializer<false, Body, Fields> |
A serializer for HTTP/1 responses.
using boost::beast::http::string_body = typedef basic_string_body<char> |
A Body using std::string
|
strong |
Error codes returned from HTTP algorithms and operations.
|
strong |
|
strong |
|
strong |
Represents the class of a status-code.
|
strong |
HTTP request method verbs
Each verb corresponds to a particular method string used in HTTP request messages.
async_return_type< ReadHandler, void(error_code, std::size_t)> boost::beast::http::async_read | ( | AsyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser, | ||
ReadHandler && | handler | ||
) |
Read a complete message from a stream asynchronously using a parser.
This function is used to asynchronously read a complete message from a stream into a subclass of basic_parser. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's async_read_some
function, and is known as a composed operation. The program must ensure that the stream performs no other operations until this operation completes. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the AsyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. The object must remain valid at least until the handler is called; ownership is not transferred. |
handler | The handler to be called when the request completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( std::size_t bytes_transferred // the number of bytes transferred to the parser ); boost::asio::io_service::post . |
true
on the parser passed in. async_return_type< ReadHandler, void(error_code, std::size_t)> boost::beast::http::async_read | ( | AsyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
message< isRequest, Body, basic_fields< Allocator >> & | msg, | ||
ReadHandler && | handler | ||
) |
Read a complete message from a stream asynchronously.
This function is used to asynchronously read a complete message from a stream using HTTP/1. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
This operation is implemented in terms of one or more calls to the stream's async_read_some
function, and is known as a composed operation. The program must ensure that the stream performs no other operations until this operation completes. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the AsyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
msg | An object in which to store the message contents. This object should not have previous contents, otherwise the behavior is undefined. The type must be MoveAssignable and MoveConstructible. |
The object must remain valid at least until the handler is called; ownership is not transferred.
handler | The handler to be called when the operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( std::size_t bytes_transferred // the number of bytes transferred to the parser ); boost::asio::io_service::post . |
async_return_type< ReadHandler, void(error_code, std::size_t)> boost::beast::http::async_read_header | ( | AsyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser, | ||
ReadHandler && | handler | ||
) |
Read a header from a stream asynchronously using a parser.
This function is used to asynchronously read a header from a stream into a subclass of basic_parser. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's async_read_some
function, and is known as a composed operation. The program must ensure that the stream performs no other operations until this operation completes. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the AsyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. The object must remain valid at least until the handler is called; ownership is not transferred. |
handler | The handler to be called when the request completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( std::size_t bytes_transferred // the number of bytes transferred to the parser ); boost::asio::io_service::post . |
false
on the parser passed in. async_return_type< ReadHandler, void(error_code, std::size_t)> boost::beast::http::async_read_some | ( | AsyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser, | ||
ReadHandler && | handler | ||
) |
Read part of a message asynchronously from a stream using a parser.
This function is used to asynchronously read part of a message from a stream into a subclass of basic_parser. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
This operation is implemented in terms of zero or more calls to the next layer's async_read_some
function, and is known as a composed operation. The program must ensure that the stream performs no other operations until this operation completes. The implementation may read additional octets that lie past the end of the object being parsed. This additional data is stored in the stream buffer, which may be used in subsequent calls.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the AsyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. The object must remain valid at least until the handler is called; ownership is not transferred. |
handler | The handler to be called when the request completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( std::size_t bytes_transferred // the number of bytes transferred to the parser ); boost::asio::io_service::post . |
The completion handler will receive as a parameter the number of octets processed from the dynamic buffer. The octets should be removed by calling consume
on the dynamic buffer after the read completes, regardless of any error.
async_return_type< WriteHandler, void(error_code, std::size_t)> boost::beast::http::async_write | ( | AsyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr, | ||
WriteHandler && | handler | ||
) |
Write a complete message to a stream asynchronously using a serializer.
This function is used to write a complete message to a stream asynchronously using a caller-provided HTTP/1 serializer. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
true
This operation is implemented in terms of zero or more calls to the stream's async_write_some
function, and is known as a composed operation. The program must ensure that the stream performs no other write operations until this operation completes.
stream | The stream to which the data is to be written. The type must support the AsyncWriteStream concept. |
sr | The serializer to use. The object must remain valid at least until the handler is called; ownership is not transferred. |
handler | The handler to be called when the operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( std::size_t bytes_transferred // the number of bytes written to the stream ); boost::asio::io_service::post . |
async_return_type< WriteHandler, void(error_code, std::size_t)> boost::beast::http::async_write | ( | AsyncWriteStream & | stream, |
message< isRequest, Body, Fields > & | msg, | ||
WriteHandler && | handler | ||
) |
Write a complete message to a stream asynchronously.
This function is used to write a complete message to a stream asynchronously using HTTP/1. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
This operation is implemented in terms of zero or more calls to the stream's async_write_some
function, and is known as a composed operation. The program must ensure that the stream performs no other write operations until this operation completes. The algorithm will use a temporary serializer with an empty chunk decorator to produce buffers. If the semantics of the message indicate that the connection should be closed after the message is sent, the error delivered by this function will be error::end_of_stream
stream | The stream to which the data is to be written. The type must support the AsyncWriteStream concept. |
msg | The message to write. The object must remain valid at least until the handler is called; ownership is not transferred. |
handler | The handler to be called when the operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( std::size_t bytes_transferred // the number of bytes written to the stream ); boost::asio::io_service::post . |
async_return_type< WriteHandler, void(error_code, std::size_t)> boost::beast::http::async_write_header | ( | AsyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr, | ||
WriteHandler && | handler | ||
) |
Write a header to a stream asynchronously using a serializer.
This function is used to write a header to a stream asynchronously using a caller-provided HTTP/1 serializer. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
true
This operation is implemented in terms of zero or more calls to the stream's async_write_some
function, and is known as a composed operation. The program must ensure that the stream performs no other write operations until this operation completes.
stream | The stream to which the data is to be written. The type must support the AsyncWriteStream concept. |
sr | The serializer to use. The object must remain valid at least until the handler is called; ownership is not transferred. |
handler | The handler to be called when the operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( std::size_t bytes_transferred // the number of bytes written to the stream ); boost::asio::io_service::post . |
true
on the serializer passed in.async_return_type< WriteHandler, void(error_code, std::size_t)> boost::beast::http::async_write_some | ( | AsyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr, | ||
WriteHandler && | handler | ||
) |
Write part of a message to a stream asynchronously using a serializer.
This function is used to write part of a message to a stream asynchronously using a caller-provided HTTP/1 serializer. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
true
This operation is implemented in terms of zero or more calls to the stream's async_write_some
function, and is known as a composed operation. The program must ensure that the stream performs no other write operations until this operation completes.
The amount of data actually transferred is controlled by the behavior of the underlying stream, subject to the buffer size limit of the serializer obtained or set through a call to serializer::limit. Setting a limit and performing bounded work helps applications set reasonable timeouts. It also allows application-level flow control to function correctly. For example when using a TCP/IP based stream.
stream | The stream to which the data is to be written. The type must support the AsyncWriteStream concept. |
sr | The serializer to use. The object must remain valid at least until the handler is called; ownership is not transferred. |
handler | The handler to be called when the operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void handler( std::size_t bytes_transferred // the number of bytes written to the stream ); boost::asio::io_service::post . |
|
inline |
Converts the integer to a known status-code.
If the integer does not match a known status code, status::unknown is returned.
auto boost::beast::http::make_chunk | ( | ConstBufferSequence const & | buffers, |
Args &&... | args | ||
) | -> chunk_body<ConstBufferSequence> |
Returns a chunk_body
This functions constructs and returns a complete chunk_body for a chunk body represented by the specified buffer sequence.
buffers | The buffers representing the chunk body. |
args | Optional arguments passed to the chunk_body constructor. |
|
inline |
Returns a chunk_last
chunk_last<Trailer> boost::beast::http::make_chunk_last | ( | Trailer const & | trailer, |
Args &&... | args | ||
) |
Returns a chunk_last
This function construct and returns a complete chunk_last for a last chunk containing the specified trailers.
trailer | A ConstBufferSequence or |
args | Optional arguments passed to the chunk_last constructor. |
|
inline |
|
inline |
Returns the obsolete reason-phrase text for a status code.
v | The status code to use. |
|
inline |
Write the text for a request method verb to an output stream.
|
delete |
|
inline |
Outputs the standard reason phrase of a status code to a stream.
|
inline |
Write the text for a field name to an output stream.
|
delete |
std::ostream& boost::beast::http::operator<< | ( | std::ostream & | os, |
header< isRequest, Fields > const & | msg | ||
) |
Serialize an HTTP/1 header to a std::ostream
.
The function converts the header to its HTTP/1 serialized representation and stores the result in the output stream.
os | The output stream to write to. |
msg | The message fields to write. |
std::ostream& boost::beast::http::operator<< | ( | std::ostream & | os, |
header< true, Fields > const & | h | ||
) |
std::ostream& boost::beast::http::operator<< | ( | std::ostream & | os, |
header< false, Fields > const & | h | ||
) |
std::ostream & boost::beast::http::operator<< | ( | std::ostream & | os, |
message< isRequest, Body, Fields > const & | msg | ||
) |
Serialize an HTTP/1 message to a std::ostream
.
The function converts the message to its HTTP/1 serialized representation and stores the result in the output stream.
The implementation will automatically perform chunk encoding if the contents of the message indicate that chunk encoding is required.
os | The output stream to write to. |
msg | The message to write. |
std::size_t boost::beast::http::read | ( | SyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser | ||
) |
Read a complete message from a stream using a parser.
This function is used to read a complete message from a stream into a subclass of basic_parser. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's read_some
function. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the SyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. |
system_error | Thrown on failure. |
true
on the parser passed in. std::size_t boost::beast::http::read | ( | SyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser, | ||
error_code & | ec | ||
) |
Read a complete message from a stream using a parser.
This function is used to read a complete message from a stream into a subclass of basic_parser. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's read_some
function. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the SyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. |
ec | Set to the error, if any occurred. |
true
on the parser passed in. std::size_t boost::beast::http::read | ( | SyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
message< isRequest, Body, basic_fields< Allocator >> & | msg | ||
) |
Read a complete message from a stream.
This function is used to read a complete message from a stream using HTTP/1. The call will block until one of the following conditions is true:
This operation is implemented in terms of one or more calls to the stream's read_some
function. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the SyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
msg | An object in which to store the message contents. This object should not have previous contents, otherwise the behavior is undefined. The type must be MoveAssignable and MoveConstructible. |
system_error | Thrown on failure. |
std::size_t boost::beast::http::read | ( | SyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
message< isRequest, Body, basic_fields< Allocator >> & | msg, | ||
error_code & | ec | ||
) |
Read a complete message from a stream.
This function is used to read a complete message from a stream using HTTP/1. The call will block until one of the following conditions is true:
This operation is implemented in terms of one or more calls to the stream's read_some
function. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the SyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
msg | An object in which to store the message contents. This object should not have previous contents, otherwise the behavior is undefined. The type must be MoveAssignable and MoveConstructible. |
ec | Set to the error, if any occurred. |
std::size_t boost::beast::http::read_header | ( | SyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser | ||
) |
Read a header from a stream using a parser.
This function is used to read a header from a stream into a subclass of basic_parser. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's read_some
function. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the SyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. |
system_error | Thrown on failure. |
false
on the parser passed in. std::size_t boost::beast::http::read_header | ( | SyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser, | ||
error_code & | ec | ||
) |
Read a header from a stream using a parser.
This function is used to read a header from a stream into a subclass of basic_parser. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's read_some
function. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the SyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. |
ec | Set to the error, if any occurred. |
false
on the parser passed in. std::size_t boost::beast::http::read_some | ( | SyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser | ||
) |
Read part of a message from a stream using a parser.
This function is used to read part of a message from a stream into a subclass of basic_parser. The call will block until one of the following conditions is true:
This operation is implemented in terms of one or more calls to the stream's read_some
function. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
stream | The stream from which the data is to be read. The type must support the SyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. |
system_error | Thrown on failure. |
std::size_t boost::beast::http::read_some | ( | SyncReadStream & | stream, |
DynamicBuffer & | buffer, | ||
basic_parser< isRequest, Derived > & | parser, | ||
error_code & | ec | ||
) |
Read part of a message from a stream using a parser.
This function is used to read part of a message from a stream into a subclass of basic_parser. The call will block until one of the following conditions is true:
This operation is implemented in terms of one or more calls to the stream's read_some
function. The implementation may read additional octets that lie past the end of the message being read. This additional data is stored in the dynamic buffer, which must be retained for subsequent reads.
If the stream returns the error boost::asio::error::eof
indicating the end of file during a read, the error returned from this function will be:
The function returns the number of bytes processed from the dynamic buffer. The caller should remove these bytes by calling consume
on the dynamic buffer, regardless of any error.
stream | The stream from which the data is to be read. The type must support the SyncReadStream concept. |
buffer | A DynamicBuffer holding additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, any data in the dynamic buffer's input sequence will be given to the parser first. |
parser | The parser to use. |
ec | Set to the error, if any occurred. |
struct boost::beast::http::std::declval< boost::optional< std::pair< typename T::reader::const_buffers_type, bool > > & > | ( | ) |
struct boost::beast::http::std::declval< std::size_t & > | ( | ) |
struct boost::beast::http::std::declval< typename T::writer & > | ( | ) |
|
inline |
Attempt to convert a string to a field enum.
The string comparison is case-insensitive.
|
inline |
Converts a string to the request method verb.
If the string does not match a known request method, verb::unknown is returned.
void boost::beast::http::swap | ( | header< true, Fields > & | h1, |
header< true, Fields > & | h2 | ||
) |
void boost::beast::http::swap | ( | header< false, Fields > & | h1, |
header< false, Fields > & | h2 | ||
) |
void boost::beast::http::swap | ( | message< isRequest, Body, Fields > & | m1, |
message< isRequest, Body, Fields > & | m2 | ||
) |
Swap two message objects.
Body::value_type
and Fields
are Swappable. void boost::beast::http::swap | ( | basic_fields< Allocator > & | lhs, |
basic_fields< Allocator > & | rhs | ||
) |
|
inline |
Convert an integer to a status_class.
v | The integer representing a status code. |
|
inline |
Convert a status_code to a status_class.
v | The status code to convert. |
|
inline |
Returns the text representation of a request method verb.
|
inline |
Convert a field enum to a string.
f | The field to convert |
bool boost::beast::http::validate_list | ( | detail::basic_parsed_list< Policy > const & | list | ) |
Returns true
if a parsed list is parsed without errors.
This function iterates a single pass through a parsed list and returns true
if there were no parsing errors, else returns false
.
std::size_t boost::beast::http::write | ( | SyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr | ||
) |
Write a complete message to a stream using a serializer.
This function is used to write a complete message to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's write_some
function.
stream | The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
sr | The serializer to use. |
system_error | Thrown on failure. |
std::size_t boost::beast::http::write | ( | SyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr, | ||
error_code & | ec | ||
) |
Write a complete message to a stream using a serializer.
This function is used to write a complete message to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's write_some
function.
stream | The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
sr | The serializer to use. |
ec | Set to the error, if any occurred. |
std::size_t boost::beast::http::write | ( | SyncWriteStream & | stream, |
message< isRequest, Body, Fields > const & | msg | ||
) |
Write a complete message to a stream.
This function is used to write a complete message to a stream using HTTP/1. The call will block until one of the following conditions is true:
This operation is implemented in terms of one or more calls to the stream's write_some
function. The algorithm will use a temporary serializer with an empty chunk decorator to produce buffers. If the semantics of the message indicate that the connection should be closed after the message is sent, the error delivered by this function will be error::end_of_stream
stream | The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
msg | The message to write. |
system_error | Thrown on failure. |
std::size_t boost::beast::http::write | ( | SyncWriteStream & | stream, |
message< isRequest, Body, Fields > const & | msg, | ||
error_code & | ec | ||
) |
Write a complete message to a stream.
This function is used to write a complete message to a stream using HTTP/1. The call will block until one of the following conditions is true:
This operation is implemented in terms of one or more calls to the stream's write_some
function. The algorithm will use a temporary serializer with an empty chunk decorator to produce buffers. If the semantics of the message indicate that the connection should be closed after the message is sent, the error delivered by this function will be error::end_of_stream
stream | The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
msg | The message to write. |
ec | Set to the error, if any occurred. |
std::size_t boost::beast::http::write_header | ( | SyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr | ||
) |
Write a header to a stream using a serializer.
This function is used to write a header to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's write_some
function.
stream | The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
sr | The serializer to use. |
system_error | Thrown on failure. |
true
on the serializer passed in.std::size_t boost::beast::http::write_header | ( | SyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr, | ||
error_code & | ec | ||
) |
Write a header to a stream using a serializer.
This function is used to write a header to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's write_some
function.
stream | The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
sr | The serializer to use. |
ec | Set to indicate what error occurred, if any. |
true
on the serializer passed in.std::size_t boost::beast::http::write_some | ( | SyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr | ||
) |
Write part of a message to a stream using a serializer.
This function is used to write part of a message to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's write_some
function.
The amount of data actually transferred is controlled by the behavior of the underlying stream, subject to the buffer size limit of the serializer obtained or set through a call to serializer::limit. Setting a limit and performing bounded work helps applications set reasonable timeouts. It also allows application-level flow control to function correctly. For example when using a TCP/IP based stream.
stream | The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
sr | The serializer to use. |
system_error | Thrown on failure. |
std::size_t boost::beast::http::write_some | ( | SyncWriteStream & | stream, |
serializer< isRequest, Body, Fields > & | sr, | ||
error_code & | ec | ||
) |
Write part of a message to a stream using a serializer.
This function is used to write part of a message to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
true
This operation is implemented in terms of one or more calls to the stream's write_some
function.
The amount of data actually transferred is controlled by the behavior of the underlying stream, subject to the buffer size limit of the serializer obtained or set through a call to serializer::limit. Setting a limit and performing bounded work helps applications set reasonable timeouts. It also allows application-level flow control to function correctly. For example when using a TCP/IP based stream.
stream | The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
sr | The serializer to use. |
ec | Set to indicate what error occurred, if any. |