forked from boostorg/beast
100 lines
3.6 KiB
Plaintext
100 lines
3.6 KiB
Plaintext
[/
|
|
Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
]
|
|
|
|
[section:http Using HTTP]
|
|
|
|
[block '''
|
|
<informaltable frame="all"><tgroup cols="1"><colspec colname="a"/><tbody><row><entry valign="top"><simplelist>
|
|
<member><link linkend="beast.http.primer">HTTP Primer</link></member>
|
|
<member><link linkend="beast.http.message">Message Containers</link></member>
|
|
<member><link linkend="beast.http.streams">Message Stream Operations</link></member>
|
|
<member><link linkend="beast.http.serializer_streams">Serializer Stream Operations</link></member>
|
|
<member><link linkend="beast.http.parser_streams">Parser Stream Operations</link></member>
|
|
<member><link linkend="beast.http.serializer_buffers">Buffer-Oriented Serializing</link></member>
|
|
<member><link linkend="beast.http.parser_buffers">Buffer-Oriented Parsing</link></member>
|
|
<member><link linkend="beast.http.custom_parsers">Custom Parsers</link></member>
|
|
<member><link linkend="beast.http.custom_body">Custom Body Types</link></member>
|
|
</simplelist></entry></row></tbody></tgroup></informaltable>
|
|
''']
|
|
|
|
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:
|
|
|
|
[variablelist
|
|
[
|
|
[Message Containers]
|
|
[
|
|
Complete HTTP messages are modeled using the __message__ class,
|
|
with possible user customizations.
|
|
]
|
|
][
|
|
[Stream Reading]
|
|
[
|
|
The functions
|
|
[link beast.ref.http__read `read`],
|
|
[link beast.ref.http__read_header `read_header`],
|
|
[link beast.ref.http__read_some `read_some`],
|
|
[link beast.ref.http__async_read `async_read`],
|
|
[link beast.ref.http__async_read_header `async_read_header`], and
|
|
[link beast.ref.http__async_read_some `async_read_some`]
|
|
read HTTP/1 message data from a
|
|
[link beast.ref.streams stream].
|
|
]
|
|
][
|
|
[Stream Writing]
|
|
[
|
|
The functions
|
|
[link beast.ref.http__write `write`],
|
|
[link beast.ref.http__write_header `write_header`],
|
|
[link beast.ref.http__write_some `write_some`],
|
|
[link beast.ref.http__async_write `async_write`],
|
|
[link beast.ref.http__async_write_header `async_write_header`], and
|
|
[link beast.ref.http__async_write_some `async_write_some`]
|
|
write HTTP/1 message data to a
|
|
[link beast.ref.streams stream].
|
|
]
|
|
][
|
|
[Serialization]
|
|
[
|
|
The __serializer__ produces a series of octet buffers
|
|
conforming to the __rfc7230__ wire representation of
|
|
a __message__.
|
|
]
|
|
][
|
|
[Parsing]
|
|
[
|
|
The __parser__ attempts to convert a series of octet
|
|
buffers into a __message__.
|
|
]
|
|
]
|
|
]
|
|
|
|
[note
|
|
The following documentation assumes some familiarity with __Asio__ and
|
|
the HTTP protocol specification described in __rfc7230__. Sample code
|
|
and identifiers mentioned in the HTTP documentation sections are
|
|
written as if these declarations are in effect:
|
|
```
|
|
#include <beast/http.hpp>
|
|
using namespace beast::http;
|
|
```
|
|
]
|
|
|
|
[include 4_1_primer.qbk]
|
|
[include 4_2_message.qbk]
|
|
[include 4_3_streams.qbk]
|
|
[include 4_4_serializer_streams.qbk]
|
|
[include 4_5_parser_streams.qbk]
|
|
[include 4_6_serializer_buffers.qbk]
|
|
[include 4_7_parser_buffers.qbk]
|
|
[include 4_8_custom_parsers.qbk]
|
|
[include 4_9_custom_body.qbk]
|
|
|
|
[endsect]
|