Skip to content

0.11 devel docfix http response status #441

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 7 commits into from
Sep 8, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 14 additions & 12 deletions libs/network/doc/examples/http/http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ Without further ado, the code to do this is as follows:
int main(int argc, char *argv[]) {
using namespace boost::network;

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
return 1;
if (argc != 2) {
std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
return 1;
}

http::client client;
http::client::request request(argv[1]);
request << header("Connection", "close");
http::client::response response = client.get(request);
std::cout << body(response) << std::endl;
request << header("Connection", "close");
http::client::response response = client.get(request);
std::cout << body(response) << std::endl;

return 0;
return 0;
}

Running the example
Expand All @@ -50,11 +50,13 @@ You can then run this to get the Boost_ website:

.. _Boost: http://www.boost.org/

.. note:: The instructions for all these examples assume that
:mod:`cpp-netlib` is build outside the source tree,
according to `CMake conventions`_. For the sake of
consistency we assume that this is in the
``~/cpp-netlib-build`` directory.
.. note::

The instructions for all these examples assume that
:mod:`cpp-netlib` is build outside the source tree,
according to `CMake conventions`_. For the sake of
consistency we assume that this is in the
``~/cpp-netlib-build`` directory.

.. _`CMake conventions`: http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F

Expand Down
14 changes: 8 additions & 6 deletions libs/network/doc/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,12 @@ additional parameters::
> -DCMAKE_CXX_COMPILER=g++ \
> ../cpp-netlib

.. note:: While it's not compulsory, it's recommended that
:mod:`cpp-netlib` is built outside the source directory.
For the purposes of documentation, we'll assume that all
builds are done in ``~/cpp-netlib-build``.
.. note::

While it's not compulsory, it's recommended that
:mod:`cpp-netlib` is built outside the source directory.
For the purposes of documentation, we'll assume that all
builds are done in ``~/cpp-netlib-build``.

If you intend to use the SSL support when using the HTTP client libraries in
:mod:`cpp-netlib`, you may need to build it with OpenSSL_ installed or at least
Expand Down Expand Up @@ -230,7 +232,7 @@ CMake projects

Projects using CMake can add the following lines in their ``CMakeLists.txt`` to
be able to use :mod:`cpp-netlib`::

set ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ~/cpp-netlib-build )
find_package ( cppnetlib 0.11.0 REQUIRED )
include_directories ( ${CPPNETLIB_INCLUDE_DIRS} )
Expand All @@ -240,7 +242,7 @@ be able to use :mod:`cpp-netlib`::
is not installed to a location that CMake searches. When :mod:`cpp-netlib`
is installed to the default location (``/usr/local``), ``CMake`` can find it.

.. note:: We assume that ``MyApplication`` is the application that you are
.. note:: We assume that ``MyApplication`` is the application that you are
building and which depends on :mod:`cpp-netlib`.


Expand Down
4 changes: 2 additions & 2 deletions libs/network/doc/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 247e8c3d216dc851efe8ee3a759ed678
tags: 645f666f9bcd5a90fca523b33c5a78b7
config: ae0de19b7b7891744d7373f4a9b6c125
tags: fbb0d17656682115ca4d033fb2f83ba1
26 changes: 14 additions & 12 deletions libs/network/doc/html/_sources/examples/http/http_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ Without further ado, the code to do this is as follows:
int main(int argc, char *argv[]) {
using namespace boost::network;

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
return 1;
if (argc != 2) {
std::cout << "Usage: " << argv[0] << " [url]" << std::endl;
return 1;
}

http::client client;
http::client::request request(argv[1]);
request << header("Connection", "close");
http::client::response response = client.get(request);
std::cout << body(response) << std::endl;
request << header("Connection", "close");
http::client::response response = client.get(request);
std::cout << body(response) << std::endl;

return 0;
return 0;
}

Running the example
Expand All @@ -50,11 +50,13 @@ You can then run this to get the Boost_ website:

.. _Boost: http://www.boost.org/

.. note:: The instructions for all these examples assume that
:mod:`cpp-netlib` is build outside the source tree,
according to `CMake conventions`_. For the sake of
consistency we assume that this is in the
``~/cpp-netlib-build`` directory.
.. note::

The instructions for all these examples assume that
:mod:`cpp-netlib` is build outside the source tree,
according to `CMake conventions`_. For the sake of
consistency we assume that this is in the
``~/cpp-netlib-build`` directory.

.. _`CMake conventions`: http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F

Expand Down
14 changes: 8 additions & 6 deletions libs/network/doc/html/_sources/getting_started.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,12 @@ additional parameters::
> -DCMAKE_CXX_COMPILER=g++ \
> ../cpp-netlib

.. note:: While it's not compulsory, it's recommended that
:mod:`cpp-netlib` is built outside the source directory.
For the purposes of documentation, we'll assume that all
builds are done in ``~/cpp-netlib-build``.
.. note::

While it's not compulsory, it's recommended that
:mod:`cpp-netlib` is built outside the source directory.
For the purposes of documentation, we'll assume that all
builds are done in ``~/cpp-netlib-build``.

If you intend to use the SSL support when using the HTTP client libraries in
:mod:`cpp-netlib`, you may need to build it with OpenSSL_ installed or at least
Expand Down Expand Up @@ -230,7 +232,7 @@ CMake projects

Projects using CMake can add the following lines in their ``CMakeLists.txt`` to
be able to use :mod:`cpp-netlib`::

set ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ~/cpp-netlib-build )
find_package ( cppnetlib 0.11.0 REQUIRED )
include_directories ( ${CPPNETLIB_INCLUDE_DIRS} )
Expand All @@ -240,7 +242,7 @@ be able to use :mod:`cpp-netlib`::
is not installed to a location that CMake searches. When :mod:`cpp-netlib`
is installed to the default location (``/usr/local``), ``CMake`` can find it.

.. note:: We assume that ``MyApplication`` is the application that you are
.. note:: We assume that ``MyApplication`` is the application that you are
building and which depends on :mod:`cpp-netlib`.


Expand Down
32 changes: 17 additions & 15 deletions libs/network/doc/html/_sources/reference/http_request.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Concept`_, otherwise it chooses the `Normal Client Request Concept`_.
Normal Client Request Concept
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A type models the Normal Client Request Concept if it models the `Message
A type models the Normal Client Request Concept if it models the `Message
Concept`_ and also supports the following constructs.

**Legend**
Expand Down Expand Up @@ -123,8 +123,8 @@ and also supports the following constructs.
Directives
----------

This section details the provided directives that are provided by
:mod:`cpp-netlib`. The section was written to assume that an appropriately
This section details the provided directives that are provided by
:mod:`cpp-netlib`. The section was written to assume that an appropriately
constructed request instance is either of the following:

.. code-block:: c++
Expand Down Expand Up @@ -152,24 +152,26 @@ Directives are meant to be used in the following manner:

request << directive(...);

.. warning:: There are two versions of directives, those that are applicable to
messages that support narrow strings (``std::string``) and those that are
applicable to messages that support wide strings (``std::wstring``). The
:mod:`cpp-netlib` implementation still does not convert wide strings into
UTF-8 encoded narrow strings. This will be implemented in subsequent
library releases.
.. warning::

For now all the implemented directives are listed, even if some of them still
do not implement things correctly.
There are two versions of directives, those that are applicable to
messages that support narrow strings (``std::string``) and those that are
applicable to messages that support wide strings (``std::wstring``). The
:mod:`cpp-netlib` implementation still does not convert wide strings into
UTF-8 encoded narrow strings. This will be implemented in subsequent
library releases.

For now all the implemented directives are listed, even if some of them still
do not implement things correctly.

*unspecified* ``source(std::string const & source_)``
Create a source directive with a ``std::string`` as a parameter, to be set
Create a source directive with a ``std::string`` as a parameter, to be set
as the source of the request.
*unspecified* ``source(std::wstring const & source_)``
Create a source directive with a ``std::wstring`` as a parameter, to be set
as the source of the request.
*unspecified* ``destination(std::string const & source_)``
Create a destination directive with a ``std::string`` as a parameter, to be
Create a destination directive with a ``std::string`` as a parameter, to be
set as the destination of the request.
*unspecified* ``destination(std::wstring const & source_)``
Create a destination directive with a ``std::wstring`` as a parameter, to be
Expand Down Expand Up @@ -200,7 +202,7 @@ Directives are meant to be used in the following manner:
Modifiers
---------

This section details the provided modifiers that are provided by
This section details the provided modifiers that are provided by
:mod:`cpp-netlib`.

``template <class Tag> inline void source(basic_request<Tag> & request, typename string<Tag>::type const & source_)``
Expand Down Expand Up @@ -232,7 +234,7 @@ section assumes that the following using namespace directives are in
effect:

.. code-block:: c++

using namespace boost::network;
using namespace boost::network::http;

Expand Down
30 changes: 15 additions & 15 deletions libs/network/doc/html/_sources/reference/http_response.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ with the HTTP Response objects.
Response Concept
----------------

A type models the Response Concept if it models the `Message Concept`_ and also
A type models the Response Concept if it models the `Message Concept`_ and also
supports the following constructs.

**Legend**
Expand Down Expand Up @@ -80,8 +80,8 @@ supports the following constructs.
Directives
----------

This section details the provided directives that are provided by
:mod:`cpp-netlib`. The section was written to assume that an appropriately
This section details the provided directives that are provided by
:mod:`cpp-netlib`. The section was written to assume that an appropriately
constructed response instance is either of the following:

.. code-block:: c++
Expand Down Expand Up @@ -109,13 +109,13 @@ Directives are meant to be used in the following manner:

response << directive(...);

.. warning:: There are four versions of directives, those that are applicable
.. warning:: There are four versions of directives, those that are applicable
to messages that support narrow strings (``std::string``), those that are
applicable to messages that support wide strings (``std::wstring``), those
that are applicable to messages that support future-wrapped narrow and wide
strings (``boost::shared_future<std::string>`` and
``boost::shared_future<std::wstring>``).
``boost::shared_future<std::wstring>``).

The :mod:`cpp-netlib` implementation still does not convert wide strings into
UTF-8 encoded narrow strings. This will be implemented in subsequent
library releases.
Expand All @@ -124,25 +124,25 @@ Directives are meant to be used in the following manner:
do not implement things correctly.

*unspecified* ``source(std::string const & source_)``
Create a source directive with a ``std::string`` as a parameter, to be set
Create a source directive with a ``std::string`` as a parameter, to be set
as the source of the response.
*unspecified* ``source(std::wstring const & source_)``
Create a source directive with a ``std::wstring`` as a parameter, to be set
as the source of the response.
*unspecified* ``source(boost::shared_future<std::string> const & source_)``
Create a source directive with a ``boost::shared_future<std::string>`` as a parameter, to be set
Create a source directive with a ``boost::shared_future<std::string>`` as a parameter, to be set
as the source of the response.
*unspecified* ``source(boost::shared_future<std::wstring> const & source_)``
Create a source directive with a ``boost::shared_future<std::wstring>`` as a parameter, to be set
as the source of the response.
*unspecified* ``destination(std::string const & source_)``
Create a destination directive with a ``std::string`` as a parameter, to be
Create a destination directive with a ``std::string`` as a parameter, to be
set as the destination of the response.
*unspecified* ``destination(std::wstring const & source_)``
Create a destination directive with a ``std::wstring`` as a parameter, to be
set as the destination of the response.
*unspecified* ``destination(boost::shared_future<std::string> const & destination_)``
Create a destination directive with a ``boost::shared_future<std::string>`` as a parameter, to be set
Create a destination directive with a ``boost::shared_future<std::string>`` as a parameter, to be set
as the destination of the response.
*unspecified* ``destination(boost::shared_future<std::wstring> const & destination_)``
Create a destination directive with a ``boost::shared_future<std::wstring>`` as a parameter, to be set
Expand Down Expand Up @@ -225,7 +225,7 @@ Directives are meant to be used in the following manner:
Modifiers
---------

This section details the provided modifiers that are provided by
This section details the provided modifiers that are provided by
:mod:`cpp-netlib`.

``template <class Tag> inline void source(basic_response<Tag> & response, typename string<Tag>::type const & source_)``
Expand All @@ -248,10 +248,10 @@ This section details the provided modifiers that are provided by
Removes a header from the given ``response``. The type of the ``name``
parameter is dependent on the ``Tag`` specialization of ``basic_response``.
``template <class Tag> inline void headers(basic_response<Tag> & response, typename headers_container<basic_response<Tag> >::type const & headers_)``
Sets the whole headers contained in ``response`` as the given parameter
Sets the whole headers contained in ``response`` as the given parameter
``headers_``.
``template <class Tag> inline void headers(basic_response<Tag> & response, boost::shared_future<typename headers_container<basic_response<Tag> >::type> const & headers_)``
Sets the whole headers contained in ``response`` as the given parameter
Sets the whole headers contained in ``response`` as the given parameter
``headers_``.
``template <class Tag> inline void clear_headers(basic_response<Tag> & response)``
Removes all headers from the given ``response``.
Expand Down Expand Up @@ -281,7 +281,7 @@ section assumes that the following using namespace directives are in
effect:

.. code-block:: c++

using namespace boost::network;
using namespace boost::network::http;

Expand All @@ -302,7 +302,7 @@ effect:
Returns a wrapper convertible to ``typename string<Tag>::type`` that
provides the version of the given response.
``template <class Tag>`` *unspecified* ``status(basic_response<Tag> const & response)``
Returns a wrapper convertible to ``typename string<Tag>::type`` that
Returns a wrapper convertible to ``typename boost::uint16_t`` that
provides the status of the given response.
``template <class Tag>`` *unspecified* ``status_message(basic_response<Tag> const & response)``
Returns a wrapper convertible to ``typename string<Tag>::type`` that
Expand Down
7 changes: 5 additions & 2 deletions libs/network/doc/html/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -89,7 +89,6 @@ div.sphinxsidebar #searchbox input[type="submit"] {

img {
border: 0;
max-width: 100%;
}

/* -- search page ----------------------------------------------------------- */
Expand Down Expand Up @@ -402,6 +401,10 @@ dl.glossary dt {
margin: 0;
}

.refcount {
color: #060;
}

.optional {
font-size: 1.3em;
}
Expand Down
Loading