Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf49739b

Browse files
committed
Fleshing out HTTP Client Reference Manual
This should be the final installment of the changes for the HTTP ClientReference Manual.
1 parentd70c887 commitf49739b

File tree

1 file changed

+87
-2
lines changed

1 file changed

+87
-2
lines changed

‎libs/network/doc/reference_http_client.rst‎

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,91 @@ happens on a different thread.
105105
Member Functions
106106
----------------
107107

108-
.. FIXME show the table of publicly-accessible member functions.
109-
108+
In this section we assume that the following typedef is in effect:
109+
110+
..code-block::c++
111+
112+
typedef boost::network::http::basic_client<
113+
boost::network::http::tags::http_default_8bit_udp_resolve
114+
, 1
115+
,1
116+
>
117+
client;
118+
119+
Also, that code using the HTTP client will have use the following header:
120+
121+
..code-block::c++
122+
123+
#include <boost/network/include/http/client.hpp>
124+
125+
Constructors
126+
~~~~~~~~~~~~
127+
128+
The client implementation can be default constructed, or customized at
129+
initialization.
130+
131+
``client()``
132+
Default constructor.
133+
``client(client::cache_resolved)``
134+
Construct a client which caches resolved endpoints.
135+
``client(client::follow_redirects)``
136+
Construct a client which follows HTTP redirects. [#]_
137+
``client(client::cache_resolved, client::follow_redirects), client(client::follow_redirects, client::cache_resolved)``
138+
Construct a client which caches resolved endpoints and follows HTTP
139+
redirects. [#]_
140+
141+
.. [#]In Asynchronous Clients, redirects are not followed. This means the
142+
response objects will contain whatever HTTP response was retrieved by the
143+
client implementation.
144+
.. [#]In Asynchronous Clients, only caching resolved endpoints take effect.
145+
146+
HTTP Methods
147+
~~~~~~~~~~~~
148+
149+
The client implementation supports various HTTP methods. The following
150+
constructs assume that a client has been properly constructed named ``client_``
151+
and that there is an appropriately constructed request object named ``request_``
152+
and that there is an appropriately constructed response object named
153+
``response_`` like the following:
154+
155+
..code-block::c++
156+
157+
client client_();
158+
client::request request_("http://cpp-netib.github.com/");
159+
client::responseresponse_;
160+
161+
``response_ = client_.get(request_)``
162+
Perform an HTTP GET request.
163+
``response_ = client_.head(request_)``
164+
Perform an HTTP HEAD request.
165+
``response_ = client_.post(request_)``
166+
Perform an HTTP POST, use the data already set in the request object which
167+
includes the headers, and the body.
168+
``response_ = client_.post(request_, body)``
169+
Body is a string of type ``boost::network::string<Tag>::type`` where ``Tag``
170+
is the HTTP Client's ``Tag``. The default content-type used is
171+
``x-application/octet-stream``.
172+
``response_ = client_.post(request_, content_type, body)``
173+
The body and content_type parameters are of type
174+
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
175+
``Tag``. This uses the request object's other headers.
176+
``response_ = client_.put(request_)``
177+
Perform an HTTP PUT, use the data already set in the request object which
178+
includes the headers, and the body.
179+
``response_ = client_.put(request_, body)``
180+
Body is a string of type ``boost::network::string<Tag>::type`` where ``Tag``
181+
is the HTTP Client's ``Tag``. The default content-type used is
182+
``x-application/octet-stream``.
183+
``response_ = client_.put(request_, content_type, body)``
184+
The body and content_type parameters are of type
185+
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
186+
``Tag``. This uses the request object's other headers.
187+
``response_ = client_.delete_(request_)``
188+
Perform an HTTP DELETE request.
189+
190+
Client-Specific
191+
~~~~~~~~~~~~~~~
192+
193+
``client_.clear_resolved_cache()``
194+
Clear the cache of resolved endpoints.
110195

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp