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

Commit466600d

Browse files
committed
Documentation updates on HTTP client
Fixes#116 for 0.11.1.
1 parent25e7a38 commit466600d

File tree

12 files changed

+88
-19
lines changed

12 files changed

+88
-19
lines changed

‎libs/network/doc/examples/http/hello_world_client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ perform the request via HTTP:
8787
http::client client;
8888
http::client::request request("http://my.webservice.com/");
8989
http::client::response =
90-
client.post(request, "application/xml", some_xml_string);
90+
client.post(request,some_xml_string,"application/xml");
9191
std::data = body(response);
9292

9393
The next set of examples show some more practical applications using

‎libs/network/doc/html/_sources/examples/http/hello_world_client.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ perform the request via HTTP:
8787
http::client client;
8888
http::client::request request("http://my.webservice.com/");
8989
http::client::response =
90-
client.post(request, "application/xml", some_xml_string);
90+
client.post(request,some_xml_string,"application/xml");
9191
std::data = body(response);
9292

9393
The next set of examples show some more practical applications using

‎libs/network/doc/html/_sources/reference/http_client.txt

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ behave as a fully synchronous client.
7171

7272
The synchronous client implements all the operations of the client underneath
7373
the interface all block to wait for I/O to finish. All the member methods are
74-
synchronous and will block until the response object is ready or throws iferros
74+
synchronous and will block until the response object is ready or throws iferrors
7575
are encountered in the performance of the HTTP requests.
7676

7777
.. warning:: The synchronous clients are **NOT** thread safe. You will need to do
@@ -137,7 +137,7 @@ In this section we assume that the following typedef is in effect:
137137
typedef boost::network::http::basic_client<
138138
boost::network::http::tags::http_default_8bit_udp_resolve
139139
, 1
140-
,1
140+
,1
141141
>
142142
client;
143143

@@ -290,6 +290,17 @@ and that there is an appropriately constructed response object named
290290
body chunks be handled by the ``callback`` parameter. The signature of
291291
``callback`` should be the following: ``void(iterator_range<char const *> const
292292
&, boost::system::error_code const &)``.
293+
``response_ = client_.post(request_, body, content_type, callback, streaming_callback)``
294+
The body and content_type parameters are of type
295+
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
296+
``Tag``. This uses the request object's other headers. Have the response
297+
body chunks be handled by the ``callback`` parameter. The signature of
298+
``callback`` should be the following: ``void(iterator_range<char const *> const
299+
&, boost::system::error_code const &)``. The ``streaming_callback``
300+
argument should have a which has a signature of the form:
301+
``bool(string_type&)``. The provided ``string_type&`` will be streamed as
302+
soon as the function returns. A return value of ``false`` signals the
303+
client that the most recent invocation is the last chunk to be sent.
293304
``response_ = client_.post(request_, streaming_callback)``
294305
Perform and HTTP POST request, and have the request's body chunks be
295306
generated by the ``streaming_callback`` which has a signature of the form:
@@ -329,13 +340,25 @@ and that there is an appropriately constructed response object named
329340
The body and content_type parameters are of type
330341
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
331342
``Tag``. This uses the request object's other headers.
332-
``response_ = client_.put(request_, body, content_type,body_handler=callback)``
343+
``response_ = client_.put(request_, body, content_type, callback)``
333344
The body and content_type parameters are of type
334345
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
335346
``Tag``. This uses the request object's other headers. Have the response
336347
body chunks be handled by the ``callback`` parameter. The signature of
337348
``callback`` should be the following: ``void(iterator_range<char const *> const
338349
&, boost::system::error_code const &)``.
350+
``response_ = client_.put(request_, body, content_type, callback, streaming_callback)``
351+
The body and content_type parameters are of type
352+
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
353+
``Tag``. This uses the request object's other headers. Have the response
354+
body chunks be handled by the ``callback`` parameter. The signature of
355+
``callback`` should be the following: ``void(iterator_range<char const *> const
356+
&, boost::system::error_code const &)``. This form also has the request's body
357+
chunks be generated by the ``streaming_callback`` which has a signature of
358+
the form: ``bool(string_type&)``. The provided ``string_type&`` will be
359+
streamed as soon as the function returns. A return value of ``false``
360+
signals the client that the most recent invocation is the last chunk to be
361+
sent
339362
``response_ = client_.put(request_, streaming_callback)``
340363
Perform and HTTP PUT request, and have the request's body chunks be
341364
generated by the ``streaming_callback`` which has a signature of the form:

‎libs/network/doc/html/contents.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ <h3>Navigation</h3>
281281
</div>
282282
<divclass="footer">
283283
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
284-
Last updated on Aug12, 2014.
284+
Last updated on Aug27, 2014.
285285
Created using<ahref="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
286286
</div>
287287
</body>

‎libs/network/doc/html/examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ <h3>Navigation</h3>
129129
</div>
130130
<divclass="footer">
131131
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
132-
Last updated on Aug12, 2014.
132+
Last updated on Aug27, 2014.
133133
Created using<ahref="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
134134
</div>
135135
</body>

‎libs/network/doc/html/examples/http/hello_world_client.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ <h2>Diving into the code<a class="headerlink" href="#diving-into-the-code" title
129129
<divclass="highlight-c++"><divclass="highlight"><pre><spanclass="n">http</span><spanclass="o">::</span><spanclass="n">client</span><spanclass="n">client</span><spanclass="p">;</span>
130130
<spanclass="n">http</span><spanclass="o">::</span><spanclass="n">client</span><spanclass="o">::</span><spanclass="n">request</span><spanclass="n">request</span><spanclass="p">(</span><spanclass="s">&quot;http://my.webservice.com/&quot;</span><spanclass="p">);</span>
131131
<spanclass="n">http</span><spanclass="o">::</span><spanclass="n">client</span><spanclass="o">::</span><spanclass="n">response</span><spanclass="o">=</span>
132-
<spanclass="n">client</span><spanclass="p">.</span><spanclass="n">post</span><spanclass="p">(</span><spanclass="n">request</span><spanclass="p">,</span><spanclass="s">&quot;application/xml&quot;</span><spanclass="p">,</span><spanclass="n">some_xml_string</span><spanclass="p">);</span>
132+
<spanclass="n">client</span><spanclass="p">.</span><spanclass="n">post</span><spanclass="p">(</span><spanclass="n">request</span><spanclass="p">,</span><spanclass="n">some_xml_string</span><spanclass="p">,</span><spanclass="s">&quot;application/xml&quot;</span><spanclass="p">);</span>
133133
<spanclass="n">std</span><spanclass="o">::</span><spanclass="n">data</span><spanclass="o">=</span><spanclass="n">body</span><spanclass="p">(</span><spanclass="n">response</span><spanclass="p">);</span>
134134
</pre></div>
135135
</div>
@@ -192,7 +192,7 @@ <h3>Navigation</h3>
192192
</div>
193193
<divclass="footer">
194194
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
195-
Last updated on Aug12, 2014.
195+
Last updated on Aug27, 2014.
196196
Created using<ahref="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
197197
</div>
198198
</body>

‎libs/network/doc/html/objects.inv

-3 Bytes
Binary file not shown.

‎libs/network/doc/html/reference.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h3>Navigation</h3>
134134
</div>
135135
<divclass="footer">
136136
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
137-
Last updated on Aug12, 2014.
137+
Last updated on Aug27, 2014.
138138
Created using<ahref="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
139139
</div>
140140
</body>

‎libs/network/doc/html/reference/http_client.html

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ <h3>Synchronous Clients<a class="headerlink" href="#synchronous-clients" title="
174174
</div></blockquote>
175175
<p>The synchronous client implements all the operations of the client underneath
176176
the interface all block to wait for I/O to finish. All the member methods are
177-
synchronous and will block until the response object is ready or throws iferros
177+
synchronous and will block until the response object is ready or throws iferrors
178178
are encountered in the performance of the HTTP requests.</p>
179179
<divclass="admonition warning">
180180
<pclass="first admonition-title">Warning</p>
@@ -237,7 +237,7 @@ <h2>Member Functions<a class="headerlink" href="#member-functions" title="Permal
237237
<divclass="highlight-c++"><divclass="highlight"><pre><spanclass="k">typedef</span><spanclass="n">boost</span><spanclass="o">::</span><spanclass="n">network</span><spanclass="o">::</span><spanclass="n">http</span><spanclass="o">::</span><spanclass="n">basic_client</span><spanclass="o">&lt;</span>
238238
<spanclass="n">boost</span><spanclass="o">::</span><spanclass="n">network</span><spanclass="o">::</span><spanclass="n">http</span><spanclass="o">::</span><spanclass="n">tags</span><spanclass="o">::</span><spanclass="n">http_default_8bit_udp_resolve</span>
239239
<spanclass="p">,</span><spanclass="mi">1</span>
240-
<spanclass="p">,</span><spanclass="mi">1</span>
240+
<spanclass="p">,</span><spanclass="mi">1</span>
241241
<spanclass="o">&gt;</span>
242242
<spanclass="n">client</span><spanclass="p">;</span>
243243
</pre></div>
@@ -417,6 +417,17 @@ <h3>HTTP Methods<a class="headerlink" href="#http-methods" title="Permalink to t
417417
body chunks be handled by the<ttclass="docutils literal"><spanclass="pre">callback</span></tt> parameter. The signature of
418418
<ttclass="docutils literal"><spanclass="pre">callback</span></tt> should be the following:<ttclass="docutils literal"><spanclass="pre">void(iterator_range&lt;char</span><spanclass="pre">const</span><spanclass="pre">*&gt;</span><spanclass="pre">const</span>
419419
<spanclass="pre">&amp;,</span><spanclass="pre">boost::system::error_code</span><spanclass="pre">const</span><spanclass="pre">&amp;)</span></tt>.</dd>
420+
<dt><ttclass="docutils literal"><spanclass="pre">response_</span><spanclass="pre">=</span><spanclass="pre">client_.post(request_,</span><spanclass="pre">body,</span><spanclass="pre">content_type,</span><spanclass="pre">callback,</span><spanclass="pre">streaming_callback)</span></tt></dt>
421+
<dd>The body and content_type parameters are of type
422+
<ttclass="docutils literal"><spanclass="pre">boost::network::string&lt;Tag&gt;::type</span></tt> where<ttclass="docutils literal"><spanclass="pre">Tag</span></tt> is the HTTP Client&#8217;s
423+
<ttclass="docutils literal"><spanclass="pre">Tag</span></tt>. This uses the request object&#8217;s other headers. Have the response
424+
body chunks be handled by the<ttclass="docutils literal"><spanclass="pre">callback</span></tt> parameter. The signature of
425+
<ttclass="docutils literal"><spanclass="pre">callback</span></tt> should be the following:<ttclass="docutils literal"><spanclass="pre">void(iterator_range&lt;char</span><spanclass="pre">const</span><spanclass="pre">*&gt;</span><spanclass="pre">const</span>
426+
<spanclass="pre">&amp;,</span><spanclass="pre">boost::system::error_code</span><spanclass="pre">const</span><spanclass="pre">&amp;)</span></tt>. The<ttclass="docutils literal"><spanclass="pre">streaming_callback</span></tt>
427+
argument should have a which has a signature of the form:
428+
<ttclass="docutils literal"><spanclass="pre">bool(string_type&amp;)</span></tt>. The provided<ttclass="docutils literal"><spanclass="pre">string_type&amp;</span></tt> will be streamed as
429+
soon as the function returns. A return value of<ttclass="docutils literal"><spanclass="pre">false</span></tt> signals the
430+
client that the most recent invocation is the last chunk to be sent.</dd>
420431
<dt><ttclass="docutils literal"><spanclass="pre">response_</span><spanclass="pre">=</span><spanclass="pre">client_.post(request_,</span><spanclass="pre">streaming_callback)</span></tt></dt>
421432
<dd>Perform and HTTP POST request, and have the request&#8217;s body chunks be
422433
generated by the<ttclass="docutils literal"><spanclass="pre">streaming_callback</span></tt> which has a signature of the form:
@@ -456,13 +467,25 @@ <h3>HTTP Methods<a class="headerlink" href="#http-methods" title="Permalink to t
456467
<dd>The body and content_type parameters are of type
457468
<ttclass="docutils literal"><spanclass="pre">boost::network::string&lt;Tag&gt;::type</span></tt> where<ttclass="docutils literal"><spanclass="pre">Tag</span></tt> is the HTTP Client&#8217;s
458469
<ttclass="docutils literal"><spanclass="pre">Tag</span></tt>. This uses the request object&#8217;s other headers.</dd>
459-
<dt><ttclass="docutils literal"><spanclass="pre">response_</span><spanclass="pre">=</span><spanclass="pre">client_.put(request_,</span><spanclass="pre">body,</span><spanclass="pre">content_type,</span><spanclass="pre">body_handler=callback)</span></tt></dt>
470+
<dt><ttclass="docutils literal"><spanclass="pre">response_</span><spanclass="pre">=</span><spanclass="pre">client_.put(request_,</span><spanclass="pre">body,</span><spanclass="pre">content_type,</span><spanclass="pre">callback)</span></tt></dt>
460471
<dd>The body and content_type parameters are of type
461472
<ttclass="docutils literal"><spanclass="pre">boost::network::string&lt;Tag&gt;::type</span></tt> where<ttclass="docutils literal"><spanclass="pre">Tag</span></tt> is the HTTP Client&#8217;s
462473
<ttclass="docutils literal"><spanclass="pre">Tag</span></tt>. This uses the request object&#8217;s other headers. Have the response
463474
body chunks be handled by the<ttclass="docutils literal"><spanclass="pre">callback</span></tt> parameter. The signature of
464475
<ttclass="docutils literal"><spanclass="pre">callback</span></tt> should be the following:<ttclass="docutils literal"><spanclass="pre">void(iterator_range&lt;char</span><spanclass="pre">const</span><spanclass="pre">*&gt;</span><spanclass="pre">const</span>
465476
<spanclass="pre">&amp;,</span><spanclass="pre">boost::system::error_code</span><spanclass="pre">const</span><spanclass="pre">&amp;)</span></tt>.</dd>
477+
<dt><ttclass="docutils literal"><spanclass="pre">response_</span><spanclass="pre">=</span><spanclass="pre">client_.put(request_,</span><spanclass="pre">body,</span><spanclass="pre">content_type,</span><spanclass="pre">callback,</span><spanclass="pre">streaming_callback)</span></tt></dt>
478+
<dd>The body and content_type parameters are of type
479+
<ttclass="docutils literal"><spanclass="pre">boost::network::string&lt;Tag&gt;::type</span></tt> where<ttclass="docutils literal"><spanclass="pre">Tag</span></tt> is the HTTP Client&#8217;s
480+
<ttclass="docutils literal"><spanclass="pre">Tag</span></tt>. This uses the request object&#8217;s other headers. Have the response
481+
body chunks be handled by the<ttclass="docutils literal"><spanclass="pre">callback</span></tt> parameter. The signature of
482+
<ttclass="docutils literal"><spanclass="pre">callback</span></tt> should be the following:<ttclass="docutils literal"><spanclass="pre">void(iterator_range&lt;char</span><spanclass="pre">const</span><spanclass="pre">*&gt;</span><spanclass="pre">const</span>
483+
<spanclass="pre">&amp;,</span><spanclass="pre">boost::system::error_code</span><spanclass="pre">const</span><spanclass="pre">&amp;)</span></tt>. This form also has the request&#8217;s body
484+
chunks be generated by the<ttclass="docutils literal"><spanclass="pre">streaming_callback</span></tt> which has a signature of
485+
the form:<ttclass="docutils literal"><spanclass="pre">bool(string_type&amp;)</span></tt>. The provided<ttclass="docutils literal"><spanclass="pre">string_type&amp;</span></tt> will be
486+
streamed as soon as the function returns. A return value of<ttclass="docutils literal"><spanclass="pre">false</span></tt>
487+
signals the client that the most recent invocation is the last chunk to be
488+
sent</dd>
466489
<dt><ttclass="docutils literal"><spanclass="pre">response_</span><spanclass="pre">=</span><spanclass="pre">client_.put(request_,</span><spanclass="pre">streaming_callback)</span></tt></dt>
467490
<dd>Perform and HTTP PUT request, and have the request&#8217;s body chunks be
468491
generated by the<ttclass="docutils literal"><spanclass="pre">streaming_callback</span></tt> which has a signature of the form:
@@ -609,7 +632,7 @@ <h3>Navigation</h3>
609632
</div>
610633
<divclass="footer">
611634
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
612-
Last updated on Aug12, 2014.
635+
Last updated on Aug27, 2014.
613636
Created using<ahref="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
614637
</div>
615638
</body>

‎libs/network/doc/html/search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ <h3>Navigation</h3>
9494
</div>
9595
<divclass="footer">
9696
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
97-
Last updated on Aug12, 2014.
97+
Last updated on Aug27, 2014.
9898
Created using<ahref="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
9999
</div>
100100
</body>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp