Skip to content
Myr

yawns

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 3f8f1dc · Browse files · 1 file+3 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+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:docs/user/advanced.rst+3 added-2 removed
87 unmodified lines
88 >>> requests.get('http://httpbin', hooks=dict(args=print_url))89 http://httpbin90 <Response [200]>9192Let's hijack some arguments this time::92Let's hijack some arguments this time with a new callback::9394 def hack_headers(args):95 if not args[headers]:96 args['headers'] = dict()9798 args['headers'].update({'X-Testing': 'True'})99100100 return args101102 hooks = dict(args=hack_headers)103 headers = dict(yo=dawg)104105And give it a try::106107 >>> requests.get('http://httpbin/headers', hooks=hooks, headers=headers)108 {109 "headers": {110 "Content-Length": "",
26 unmodified lines