Skip to content

Commit a36c39b

Browse files
committed
Initial documentation for the HTTP Client Request.
1 parent ff26d2d commit a36c39b

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

libs/network/doc/reference.rst

+2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ to the different client and/or server implementations within :mod:`cpp-netlib`.
99
:maxdepth: 2
1010

1111
reference_http_client.rst
12+
reference_http_request.rst
13+
reference_http_response.rst
1214
reference_http_server.rst
1315

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
HTTP Request
3+
============
4+
5+
This part of the documentation talks about the publicly accessible API of the
6+
HTTP Request objects. This section details the `Request Concepts`_ requirements,
7+
the implemented and required Directives_, Modifiers_, and Wrappers_ that work
8+
with the HTTP Request objects.
9+
10+
Request Concepts
11+
----------------
12+
13+
There are two generally supported Request Concepts implemented in the library.
14+
The first of two is the `Normal Client Request Concept`_ and the second is the
15+
`Pod Server Request Concept`_.
16+
17+
The `Normal Client Request Concept`_ is what the HTTP Client interface requires.
18+
All operations performed internally by the HTTP Client abide by the interface
19+
required by this concept definition.
20+
21+
The `Pod Server Request Concept`_ is as the name suggests what the HTTP Server
22+
implementation requires from Request Objects.
23+
24+
Switching on whether the `Request` concept chooses either of the `Normal Client
25+
Request Concept`_ or the `Pod Server Request Concept`_ is done through the
26+
nested ``tag`` type and whether that tag derives from the root tag ``pod``.
27+
Simply, if the Request type's nested ``tag`` type derives from
28+
``boost::network::tags::pod`` then it chooses to enforce the `Pod Server Request
29+
Concept`_, otherwise it chooses the `Normal Client Request Concept`_.
30+
31+
Normal Client Request Concept
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
34+
A type models the Normal Client Request Concept if it models the `Message
35+
Concept`_ and also supports the following constructs.
36+
37+
**Legend**
38+
39+
:R: The request type.
40+
:r: An instance of R.
41+
:S: The string type.
42+
:s: An instance of S.
43+
:P: The port type.
44+
:p: An instance of P.
45+
46+
+-----------------------+-------------+----------------------------------------+
47+
| Construct | Result | Description |
48+
+=======================+=============+========================================+
49+
| ``R::string_type`` | ``S`` | The nested ``string_type`` type. |
50+
+-----------------------+-------------+----------------------------------------+
51+
| ``R::port_type`` | ``P`` | The nested ``port_type`` type. |
52+
+-----------------------+-------------+----------------------------------------+
53+
| ``R r(s)`` | **NA** | Construct a Request with an ``s`` |
54+
| | | provided. This treats ``s`` as the URI |
55+
| | | to where the request is destined for. |
56+
+-----------------------+-------------+----------------------------------------+
57+
| ``host(request)`` | Convertible | Return the host to where the request |
58+
| | to ``S`` | is destined for. |
59+
+-----------------------+-------------+----------------------------------------+
60+
| ``port(request)`` | Convertible | Return the port to where the request |
61+
| | to ``P`` | is destined for. |
62+
+-----------------------+-------------+----------------------------------------+
63+
| ``path(request)`` | Convertible | Return the path included in the URI. |
64+
| | to ``S`` | |
65+
+-----------------------+-------------+----------------------------------------+
66+
| ``query(request)`` | Convertible | Return the query part of the URI. |
67+
| | to ``S`` | |
68+
+-----------------------+-------------+----------------------------------------+
69+
| ``anchor(request)`` | Convertible | Return the anchor part of the URI. |
70+
| | to ``S`` | |
71+
+-----------------------+-------------+----------------------------------------+
72+
| ``protocol(request)`` | Convertible | Return the protocol/scheme part of the |
73+
| | to ``S`` | URI. |
74+
+-----------------------+-------------+----------------------------------------+
75+
| ``r << uri(s)`` | ``R&`` | Set the URI of the request. |
76+
+-----------------------+-------------+----------------------------------------+
77+
| ``uri(r, s)`` | ``void`` | Set the URI of the request. |
78+
+-----------------------+-------------+----------------------------------------+
79+
80+
81+
82+
Directives
83+
----------
84+
85+
Modifiers
86+
---------
87+
88+
Wrappers
89+
--------

0 commit comments

Comments
 (0)