Clarify that a Session can have multiple hooks

This commit is contained in:
Alex Chan
2017-10-23 13:25:46 +01:00
parent 87f3b0a559
commit 40c5a8b0c2
+5 -2
View File
@@ -458,8 +458,8 @@ Let's print some request method arguments at runtime::
http://httpbin.org
<Response [200]>
You can also assign hooks to a ``Session`` instance. The hook will then be
called on every request made to the session. For example::
You can also add hooks to a ``Session`` instance. Any hooks you add will then
be called on every request made to the session. For example::
>>> s = requests.Session()
>>> s.hooks['response'].append(print_url)
@@ -467,6 +467,9 @@ called on every request made to the session. For example::
http://httpbin.org
<Response [200]>
A ``Session`` can have multiple hooks, which will be called in the order
they are added.
.. _custom-auth:
Custom Authentication