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:
89241c5
)
use session's hooks as defaults for every requests.
author
Rolando Espinoza La fuente
<darkrho@gmail.com>
Fri, 18 Nov 2011 22:19:27 +0000
(18:19 -0400)
committer
Rolando Espinoza La fuente
<darkrho@gmail.com>
Fri, 18 Nov 2011 22:19:27 +0000
(18:19 -0400)
requests/sessions.py
patch
|
blob
|
history
diff --git
a/requests/sessions.py
b/requests/sessions.py
index
9610fd5
..
247aa18
100644
(file)
--- a/
requests/sessions.py
+++ b/
requests/sessions.py
@@
-140,6
+140,10
@@
class Session(object):
files = {} if files is None else files
headers = {} if headers is None else headers
params = {} if params is None else params
+ hooks = {} if hooks is None else hooks
+ # use session's hooks as defaults
+ for key, cb in self.hooks.iteritems():
+ hooks.setdefault(key, cb)
# Expand header values.
if headers: