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

Documentation fixes#428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
glynos merged 2 commits intocpp-netlib:0.11-develfromdeanberris:0.11-devel-docfix
Aug 27, 2014
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Documentation updates on HTTP client
Fixes#116 for 0.11.1.
  • Loading branch information
@deanberris
deanberris committedAug 27, 2014
commit466600d99378a56717df0f4c3ee95c0ac05d41dd
2 changes: 1 addition & 1 deletionlibs/network/doc/examples/http/hello_world_client.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -87,7 +87,7 @@ perform the request via HTTP:
http::client client;
http::client::request request("http://my.webservice.com/");
http::client::response =
client.post(request, "application/xml", some_xml_string);
client.post(request,some_xml_string,"application/xml");
std::data = body(response);

The next set of examples show some more practical applications using
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -87,7 +87,7 @@ perform the request via HTTP:
http::client client;
http::client::request request("http://my.webservice.com/");
http::client::response =
client.post(request, "application/xml", some_xml_string);
client.post(request,some_xml_string,"application/xml");
std::data = body(response);

The next set of examples show some more practical applications using
Expand Down
29 changes: 26 additions & 3 deletionslibs/network/doc/html/_sources/reference/http_client.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -71,7 +71,7 @@ behave as a fully synchronous client.

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

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

Expand DownExpand Up@@ -290,6 +290,17 @@ and that there is an appropriately constructed response object named
body chunks be handled by the ``callback`` parameter. The signature of
``callback`` should be the following: ``void(iterator_range<char const *> const
&, boost::system::error_code const &)``.
``response_ = client_.post(request_, body, content_type, callback, streaming_callback)``
The body and content_type parameters are of type
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
``Tag``. This uses the request object's other headers. Have the response
body chunks be handled by the ``callback`` parameter. The signature of
``callback`` should be the following: ``void(iterator_range<char const *> const
&, boost::system::error_code const &)``. The ``streaming_callback``
argument should have a which has a signature of the form:
``bool(string_type&)``. The provided ``string_type&`` will be streamed as
soon as the function returns. A return value of ``false`` signals the
client that the most recent invocation is the last chunk to be sent.
``response_ = client_.post(request_, streaming_callback)``
Perform and HTTP POST request, and have the request's body chunks be
generated by the ``streaming_callback`` which has a signature of the form:
Expand DownExpand Up@@ -329,13 +340,25 @@ and that there is an appropriately constructed response object named
The body and content_type parameters are of type
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
``Tag``. This uses the request object's other headers.
``response_ = client_.put(request_, body, content_type,body_handler=callback)``
``response_ = client_.put(request_, body, content_type, callback)``
The body and content_type parameters are of type
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
``Tag``. This uses the request object's other headers. Have the response
body chunks be handled by the ``callback`` parameter. The signature of
``callback`` should be the following: ``void(iterator_range<char const *> const
&, boost::system::error_code const &)``.
``response_ = client_.put(request_, body, content_type, callback, streaming_callback)``
The body and content_type parameters are of type
``boost::network::string<Tag>::type`` where ``Tag`` is the HTTP Client's
``Tag``. This uses the request object's other headers. Have the response
body chunks be handled by the ``callback`` parameter. The signature of
``callback`` should be the following: ``void(iterator_range<char const *> const
&, boost::system::error_code const &)``. This form also has the request's body
chunks be generated by the ``streaming_callback`` which has a signature of
the form: ``bool(string_type&)``. The provided ``string_type&`` will be
streamed as soon as the function returns. A return value of ``false``
signals the client that the most recent invocation is the last chunk to be
sent
``response_ = client_.put(request_, streaming_callback)``
Perform and HTTP PUT request, and have the request's body chunks be
generated by the ``streaming_callback`` which has a signature of the form:
Expand Down
2 changes: 1 addition & 1 deletionlibs/network/doc/html/contents.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -281,7 +281,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
Last updated on Aug12, 2014.
Last updated on Aug27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletionlibs/network/doc/html/examples.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -129,7 +129,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
Last updated on Aug12, 2014.
Last updated on Aug27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -129,7 +129,7 @@ <h2>Diving into the code<a class="headerlink" href="#diving-into-the-code" title
<div class="highlight-c++"><div class="highlight"><pre><span class="n">http</span><span class="o">::</span><span class="n">client</span> <span class="n">client</span><span class="p">;</span>
<span class="n">http</span><span class="o">::</span><span class="n">client</span><span class="o">::</span><span class="n">request</span> <span class="n">request</span><span class="p">(</span><span class="s">&quot;http://my.webservice.com/&quot;</span><span class="p">);</span>
<span class="n">http</span><span class="o">::</span><span class="n">client</span><span class="o">::</span><span class="n">response</span> <span class="o">=</span>
<span class="n">client</span><span class="p">.</span><span class="n">post</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="s">&quot;application/xml&quot;</span><span class="p">,</span> <span class="n">some_xml_string</span><span class="p">);</span>
<span class="n">client</span><span class="p">.</span><span class="n">post</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">some_xml_string</span><span class="p">,</span> <span class="s">&quot;application/xml&quot;</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">data</span> <span class="o">=</span> <span class="n">body</span><span class="p">(</span><span class="n">response</span><span class="p">);</span>
</pre></div>
</div>
Expand DownExpand Up@@ -192,7 +192,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
Last updated on Aug12, 2014.
Last updated on Aug27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
Binary file modifiedlibs/network/doc/html/objects.inv
View file
Open in desktop
Binary file not shown.
2 changes: 1 addition & 1 deletionlibs/network/doc/html/reference.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -134,7 +134,7 @@ <h3>Navigation</h3>
</div>
<divclass="footer">
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
Last updated on Aug12, 2014.
Last updated on Aug27, 2014.
Created using<ahref="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
31 changes: 27 additions & 4 deletionslibs/network/doc/html/reference/http_client.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -174,7 +174,7 @@ <h3>Synchronous Clients<a class="headerlink" href="#synchronous-clients" title="
</div></blockquote>
<p>The synchronous client implements all the operations of the client underneath
the interface all block to wait for I/O to finish. All the member methods are
synchronous and will block until the response object is ready or throws iferros
synchronous and will block until the response object is ready or throws iferrors
are encountered in the performance of the HTTP requests.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
Expand DownExpand Up@@ -237,7 +237,7 @@ <h2>Member Functions<a class="headerlink" href="#member-functions" title="Permal
<div class="highlight-c++"><div class="highlight"><pre><span class="k">typedef</span> <span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="o">::</span><span class="n">basic_client</span><span class="o">&lt;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="o">::</span><span class="n">tags</span><span class="o">::</span><span class="n">http_default_8bit_udp_resolve</span>
<span class="p">,</span> <span class="mi">1</span>
<span class="p">,</span><span class="mi">1</span>
<span class="p">,</span><span class="mi">1</span>
<span class="o">&gt;</span>
<span class="n">client</span><span class="p">;</span>
</pre></div>
Expand DownExpand Up@@ -417,6 +417,17 @@ <h3>HTTP Methods<a class="headerlink" href="#http-methods" title="Permalink to t
body chunks be handled by the <tt class="docutils literal"><span class="pre">callback</span></tt> parameter. The signature of
<tt class="docutils literal"><span class="pre">callback</span></tt> should be the following: <tt class="docutils literal"><span class="pre">void(iterator_range&lt;char</span> <span class="pre">const</span> <span class="pre">*&gt;</span> <span class="pre">const</span>
<span class="pre">&amp;,</span> <span class="pre">boost::system::error_code</span> <span class="pre">const</span> <span class="pre">&amp;)</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">response_</span> <span class="pre">=</span> <span class="pre">client_.post(request_,</span> <span class="pre">body,</span> <span class="pre">content_type,</span> <span class="pre">callback,</span> <span class="pre">streaming_callback)</span></tt></dt>
<dd>The body and content_type parameters are of type
<tt class="docutils literal"><span class="pre">boost::network::string&lt;Tag&gt;::type</span></tt> where <tt class="docutils literal"><span class="pre">Tag</span></tt> is the HTTP Client&#8217;s
<tt class="docutils literal"><span class="pre">Tag</span></tt>. This uses the request object&#8217;s other headers. Have the response
body chunks be handled by the <tt class="docutils literal"><span class="pre">callback</span></tt> parameter. The signature of
<tt class="docutils literal"><span class="pre">callback</span></tt> should be the following: <tt class="docutils literal"><span class="pre">void(iterator_range&lt;char</span> <span class="pre">const</span> <span class="pre">*&gt;</span> <span class="pre">const</span>
<span class="pre">&amp;,</span> <span class="pre">boost::system::error_code</span> <span class="pre">const</span> <span class="pre">&amp;)</span></tt>. The <tt class="docutils literal"><span class="pre">streaming_callback</span></tt>
argument should have a which has a signature of the form:
<tt class="docutils literal"><span class="pre">bool(string_type&amp;)</span></tt>. The provided <tt class="docutils literal"><span class="pre">string_type&amp;</span></tt> will be streamed as
soon as the function returns. A return value of <tt class="docutils literal"><span class="pre">false</span></tt> signals the
client that the most recent invocation is the last chunk to be sent.</dd>
<dt><tt class="docutils literal"><span class="pre">response_</span> <span class="pre">=</span> <span class="pre">client_.post(request_,</span> <span class="pre">streaming_callback)</span></tt></dt>
<dd>Perform and HTTP POST request, and have the request&#8217;s body chunks be
generated by the <tt class="docutils literal"><span class="pre">streaming_callback</span></tt> which has a signature of the form:
Expand DownExpand Up@@ -456,13 +467,25 @@ <h3>HTTP Methods<a class="headerlink" href="#http-methods" title="Permalink to t
<dd>The body and content_type parameters are of type
<tt class="docutils literal"><span class="pre">boost::network::string&lt;Tag&gt;::type</span></tt> where <tt class="docutils literal"><span class="pre">Tag</span></tt> is the HTTP Client&#8217;s
<tt class="docutils literal"><span class="pre">Tag</span></tt>. This uses the request object&#8217;s other headers.</dd>
<dt><tt class="docutils literal"><span class="pre">response_</span> <span class="pre">=</span> <span class="pre">client_.put(request_,</span> <span class="pre">body,</span> <span class="pre">content_type,</span> <span class="pre">body_handler=callback)</span></tt></dt>
<dt><tt class="docutils literal"><span class="pre">response_</span> <span class="pre">=</span> <span class="pre">client_.put(request_,</span> <span class="pre">body,</span> <span class="pre">content_type,</span> <span class="pre">callback)</span></tt></dt>
<dd>The body and content_type parameters are of type
<tt class="docutils literal"><span class="pre">boost::network::string&lt;Tag&gt;::type</span></tt> where <tt class="docutils literal"><span class="pre">Tag</span></tt> is the HTTP Client&#8217;s
<tt class="docutils literal"><span class="pre">Tag</span></tt>. This uses the request object&#8217;s other headers. Have the response
body chunks be handled by the <tt class="docutils literal"><span class="pre">callback</span></tt> parameter. The signature of
<tt class="docutils literal"><span class="pre">callback</span></tt> should be the following: <tt class="docutils literal"><span class="pre">void(iterator_range&lt;char</span> <span class="pre">const</span> <span class="pre">*&gt;</span> <span class="pre">const</span>
<span class="pre">&amp;,</span> <span class="pre">boost::system::error_code</span> <span class="pre">const</span> <span class="pre">&amp;)</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">response_</span> <span class="pre">=</span> <span class="pre">client_.put(request_,</span> <span class="pre">body,</span> <span class="pre">content_type,</span> <span class="pre">callback,</span> <span class="pre">streaming_callback)</span></tt></dt>
<dd>The body and content_type parameters are of type
<tt class="docutils literal"><span class="pre">boost::network::string&lt;Tag&gt;::type</span></tt> where <tt class="docutils literal"><span class="pre">Tag</span></tt> is the HTTP Client&#8217;s
<tt class="docutils literal"><span class="pre">Tag</span></tt>. This uses the request object&#8217;s other headers. Have the response
body chunks be handled by the <tt class="docutils literal"><span class="pre">callback</span></tt> parameter. The signature of
<tt class="docutils literal"><span class="pre">callback</span></tt> should be the following: <tt class="docutils literal"><span class="pre">void(iterator_range&lt;char</span> <span class="pre">const</span> <span class="pre">*&gt;</span> <span class="pre">const</span>
<span class="pre">&amp;,</span> <span class="pre">boost::system::error_code</span> <span class="pre">const</span> <span class="pre">&amp;)</span></tt>. This form also has the request&#8217;s body
chunks be generated by the <tt class="docutils literal"><span class="pre">streaming_callback</span></tt> which has a signature of
the form: <tt class="docutils literal"><span class="pre">bool(string_type&amp;)</span></tt>. The provided <tt class="docutils literal"><span class="pre">string_type&amp;</span></tt> will be
streamed as soon as the function returns. A return value of <tt class="docutils literal"><span class="pre">false</span></tt>
signals the client that the most recent invocation is the last chunk to be
sent</dd>
<dt><tt class="docutils literal"><span class="pre">response_</span> <span class="pre">=</span> <span class="pre">client_.put(request_,</span> <span class="pre">streaming_callback)</span></tt></dt>
<dd>Perform and HTTP PUT request, and have the request&#8217;s body chunks be
generated by the <tt class="docutils literal"><span class="pre">streaming_callback</span></tt> which has a signature of the form:
Expand DownExpand Up@@ -609,7 +632,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
Last updated on Aug12, 2014.
Last updated on Aug27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletionlibs/network/doc/html/search.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -94,7 +94,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
Last updated on Aug12, 2014.
Last updated on Aug27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletionlibs/network/doc/html/searchindex.js
View file
Open in desktop

Large diffs are not rendered by default.

Loading

[8]ページ先頭

©2009-2025 Movatter.jp