projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f8f1dc
)
yawns
author
Kenneth Reitz
<me@kennethreitz.com>
Wed, 17 Aug 2011 07:21:31 +0000
(
03:21
-0400)
committer
Kenneth Reitz
<me@kennethreitz.com>
Wed, 17 Aug 2011 07:21:31 +0000
(
03:21
-0400)
docs/user/advanced.rst
patch
|
blob
|
history
diff --git
a/docs/user/advanced.rst
b/docs/user/advanced.rst
index 499c354d54338ce3cccad57a4f8c4a10fefb1020..83792b58c43f96f9f3b518a37c35d351af14541e 100644
(file)
--- a/
docs/user/advanced.rst
+++ b/
docs/user/advanced.rst
@@
-89,7
+89,7
@@
Let's print some request method arguments at runtime::
http://httpbin
<Response [200]>
-Let's hijack some arguments this time::
+Let's hijack some arguments this time
with a new callback
::
def hack_headers(args):
if not args[headers]:
@@
-97,12
+97,13
@@
Let's hijack some arguments this time::
args['headers'].update({'X-Testing': 'True'})
-
return args
hooks = dict(args=hack_headers)
headers = dict(yo=dawg)
+And give it a try::
+
>>> requests.get('http://httpbin/headers', hooks=hooks, headers=headers)
{
"headers": {