summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAndrey Petrov <andrey.petrov@shazow.net>2014-07-01 14:54:13 -0700
committerAndrey Petrov <andrey.petrov@shazow.net>2014-07-01 14:54:13 -0700
commit5266d0086bb8cfc31875de781fd88eae3b76a6c2 (patch)
tree0bd9b66d38b5b48e4da4d17cc2fa95fe5c8a0e2b /docs
parent47399c3819116d97db94dc529f3958c4b77808c0 (diff)
downloadurllib3-5266d0086bb8cfc31875de781fd88eae3b76a6c2.tar.gz
More docs, moved _observed_errors param.
Diffstat (limited to 'docs')
-rw-r--r--docs/fields.rst10
-rw-r--r--docs/helpers.rst26
-rw-r--r--docs/index.rst37
3 files changed, 49 insertions, 24 deletions
diff --git a/docs/fields.rst b/docs/fields.rst
deleted file mode 100644
index 67ca3f94..00000000
--- a/docs/fields.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-Request Fields
-==============
-
-These classes encapsulate a request parameters or fields and are suitable for
-passing to :meth:`~urllib3.request.RequestMethods.request`.
-
-.. automodule:: urllib3.fields
-
- .. autoclass:: RequestField
- :members:
diff --git a/docs/helpers.rst b/docs/helpers.rst
index 1b09195f..79f268ba 100644
--- a/docs/helpers.rst
+++ b/docs/helpers.rst
@@ -23,35 +23,33 @@ URL Helpers
.. automodule:: urllib3.util.url
:members:
-SSL Utilities
--------------
-
-.. automodule:: urllib3.util.connection
- :members:
-.. automodule:: urllib3.util.request
- :members:
-.. automodule:: urllib3.util.request
- :members:
-.. automodule:: urllib3.util.ssl_
- :members:
-.. automodule:: urllib3.util.url
- :members:
-
Filepost
--------
.. automodule:: urllib3.filepost
:members:
+.. automodule:: urllib3.fields
+ :members:
+
Request
-------
.. automodule:: urllib3.request
:members:
+.. automodule:: urllib3.util.request
+ :members:
+
Response
--------
.. automodule:: urllib3.response
:members:
:undoc-members:
+
+SSL/TLS Helpers
+---------------
+
+.. automodule:: urllib3.util.ssl_
+ :members:
diff --git a/docs/index.rst b/docs/index.rst
index ae38e309..a6bfda43 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -152,6 +152,7 @@ should use a :class:`~urllib3.poolmanager.PoolManager`.
A :class:`~urllib3.connectionpool.ConnectionPool` is composed of a collection
of :class:`httplib.HTTPConnection` objects.
+
Timeout
-------
@@ -181,6 +182,41 @@ set for the entire pool or per-request.
>>> # Same Manager but request with a 5 second total timeout.
>>> r = http.request('GET', 'http://httpbin.org/delay/1', timeout=Timeout(total=5.0))
+See the :class:`~urllib3.util.timeout.Timeout` definition for more details.
+
+
+Retry
+-----
+
+Retries can be configured by passing an instance of
+:class:`~urllib3.util.retry.Retry`, or disabled by passing ``False``, to the
+``retries`` parameter.
+
+Redirects are also considered to be a subset of retries but can be configured or
+disabled individually.
+
+::
+
+ >>> from urllib3 import PoolManager, Retry
+
+ >>> # Allow 3 retries total for all requests in this pool. These are the same:
+ >>> http = PoolManager(retries=3)
+ >>> http = PoolManager(retries=Retry(3))
+ >>> http = PoolManager(retries=Retry(total=3))
+
+ >>> r = http.request('GET', 'http://httpbin.org/redirect/2')
+ >>> # r.status -> 200
+
+ >>> # Disable redirects for this request.
+ >>> r = http.request('GET', 'http://httpbin.org/redirect/2', retries=Retry(3, redirect=False))
+ >>> # r.status -> 302
+
+ >>> # No total limit, but only do 5 connect retries, for this request.
+ >>> r = http.request('GET', 'http://httpbin.org/', retries=Retry(connect=5))
+
+
+See the :class:`~urllib3.util.retry.Retry` definition for more details.
+
Foundation
----------
@@ -196,6 +232,7 @@ but can also be used independently.
.. toctree::
helpers
+ exceptions
Contrib Modules
---------------