Skip to content
Myr

Add something to the docs about hooks on Session()

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 c4c031f · Browse files · 1 file+9 added−0 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+9 added−0 removed

  • other:+9 added−0 removed

1 file+9 added−0 removed

modified:docs/user/advanced.rst+9 added
456 unmodified lines
457 >>> requests.get('http://httpbin.org', hooks=dict(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::463464 >>> s = requests.Session()465 >>> s.hooks = dict(response=print_url)466 >>> s.get('http://httpbin.org')467 http://httpbin.org468 <Response [200]>469470.. _custom-auth:471472Custom Authentication473---------------------
548 unmodified lines