Skip to content
Myr

Clarify that a Session can have multiple hooks

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Alex Chan · committed by Alex Chan · parent 87f3b0a · Browse files · 1 file+5 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−2 removed

  • other:+5 added−2 removed

1 file+5 added−2 removed

modified:docs/user/advanced.rst+5 added-2 removed
456 unmodified lines
457 >>> requests.get('http://httpbin.org', hooks={'response': print_url})458 http://httpbin.org459 <Response [200]>460461You can also assign hooks to a ``Session`` instance. The hook will then be462called on every request made to the session. For example::461You can also add hooks to a ``Session`` instance. Any hooks you add will then462be called on every request made to the session. For example::463464 >>> s = requests.Session()465 >>> s.hooks['response'].append(print_url)466 >>> s.get('http://httpbin.org')467 http://httpbin.org468 <Response [200]>469470A ``Session`` can have multiple hooks, which will be called in the order471they are added.472473.. _custom-auth:474475Custom Authentication476---------------------
548 unmodified lines