summaryrefslogtreecommitdiff
path: root/docs/api.rst
diff options
context:
space:
mode:
authorKevin Burke <kev@inburke.com>2014-08-29 11:33:46 -0700
committerKevin Burke <kev@inburke.com>2014-08-29 11:50:11 -0700
commitdfa41afd43a15222eb7a2db35feadd36dba4b445 (patch)
tree4f09b8e4275e2756777dfa30515ced45db3687b0 /docs/api.rst
parent5f483369aaa25cae14d9974d4a1b0a154b27423a (diff)
downloadpython-requests-dfa41afd43a15222eb7a2db35feadd36dba4b445.tar.gz
Document Timeout behaviour
Diffstat (limited to 'docs/api.rst')
-rw-r--r--docs/api.rst20
1 files changed, 2 insertions, 18 deletions
diff --git a/docs/api.rst b/docs/api.rst
index 69f138a2..f1242ccb 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -60,6 +60,8 @@ Exceptions
.. autoexception:: requests.exceptions.HTTPError
.. autoexception:: requests.exceptions.URLRequired
.. autoexception:: requests.exceptions.TooManyRedirects
+.. autoexception:: requests.exceptions.ConnectTimeout
+.. autoexception:: requests.exceptions.ReadTimeout
.. autoexception:: requests.exceptions.Timeout
@@ -255,21 +257,3 @@ Behavioral Changes
keys are not native strings (unicode on Python2 or bytestrings on Python 3)
they will be converted to the native string type assuming UTF-8 encoding.
-* Timeouts behave slightly differently. On streaming requests, the timeout
- only applies to the connection attempt. On regular requests, the timeout
- is applied to the connection process and on to all attempts to read data from
- the underlying socket. It does *not* apply to the total download time for the
- request.
-
- ::
-
- tarball_url = 'https://github.com/kennethreitz/requests/tarball/master'
-
- # One second timeout for the connection attempt
- # Unlimited time to download the tarball
- r = requests.get(tarball_url, stream=True, timeout=1)
-
- # One second timeout for the connection attempt
- # Another full second timeout to download the tarball
- r = requests.get(tarball_url, timeout=1)
-