diff options
| author | Alex Chan <a.chan@wellcome.ac.uk> | 2017-10-23 08:30:35 +0100 |
|---|---|---|
| committer | Alex Chan <a.chan@wellcome.ac.uk> | 2017-10-23 08:30:35 +0100 |
| commit | 2c4849defeda74c191c35c4b1997547b1aae425e (patch) | |
| tree | b552b8d1a726bd336070392c3c20850ce57c074e /docs/user | |
| parent | c4c031fc5c62fac25c155e6870962736eb363dc9 (diff) | |
| download | python-requests-2c4849defeda74c191c35c4b1997547b1aae425e.tar.gz | |
Add something to the docs about hooks on Session()
Diffstat (limited to 'docs/user')
| -rw-r--r-- | docs/user/advanced.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 613df205..443b43e9 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -458,6 +458,15 @@ 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:: + + >>> s = requests.Session() + >>> s.hooks = dict(response=print_url) + >>> s.get('http://httpbin.org') + http://httpbin.org + <Response [200]> + .. _custom-auth: Custom Authentication |
