Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 27, 2014
Merged
Show file tree
Hide file tree
Changes from 1 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
Prev Previous commit
Documentation updates on HTTP client
Fixes #116 for 0.11.1.
  • Loading branch information
deanberris committed Aug 27, 2014
commit 466600d99378a56717df0f4c3ee95c0ac05d41dd
2 changes: 1 addition & 1 deletion libs/network/doc/examples/http/hello_world_client.rst
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 deletions libs/network/doc/html/_sources/reference/http_client.txt
Original file line number Diff line number Diff 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 if erros
synchronous and will block until the response object is ready or throws if errors
are encountered in the performance of the HTTP requests.

.. warning:: The synchronous clients are **NOT** thread safe. You will need to do
Expand Down Expand 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 Down Expand 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 Down Expand 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 deletion libs/network/doc/html/contents.html
Original file line number Diff line number Diff 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 Aug 12, 2014.
Last updated on Aug 27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion libs/network/doc/html/examples.html
Original file line number Diff line number Diff 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 Aug 12, 2014.
Last updated on Aug 27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
4 changes: 2 additions & 2 deletions libs/network/doc/html/examples/http/hello_world_client.html
Original file line number Diff line number Diff 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 Down Expand 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 Aug 12, 2014.
Last updated on Aug 27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
Binary file modified libs/network/doc/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion libs/network/doc/html/reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2008-2014, Glyn Matthews, Dean Michael Berris; 2013 Google, Inc..
Last updated on Aug 12, 2014.
Last updated on Aug 27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
31 changes: 27 additions & 4 deletions libs/network/doc/html/reference/http_client.html
Original file line number Diff line number Diff 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 if erros
synchronous and will block until the response object is ready or throws if errors
are encountered in the performance of the HTTP requests.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
Expand Down Expand 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 Down Expand 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 Down Expand 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 Down Expand 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 Aug 12, 2014.
Last updated on Aug 27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion libs/network/doc/html/search.html
Original file line number Diff line number Diff 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 Aug 12, 2014.
Last updated on Aug 27, 2014.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion libs/network/doc/html/searchindex.js

Large diffs are not rendered by default.

Loading