This commit is contained in:
Kenneth Reitz
2012-12-17 03:56:58 -05:00
parent ee6c638e9c
commit 03c8e23dbb
2 changed files with 4 additions and 10 deletions
+1 -10
View File
@@ -8,22 +8,13 @@ This module provides the capabilities for the Requests hooks system.
Available hooks:
``pre_request``:
The Request object, directly after being created.
``pre_send``:
The Request object, directly before being sent.
``post_request``:
The Request object, directly after being sent.
``response``:
The response generated from a Request.
"""
HOOKS = ('pre_prepare', 'post_prepare', 'pre_request', 'pre_send', 'post_request', 'response')
HOOKS = ('response')
# TODO: response is the only one
def dispatch_hook(key, hooks, hook_data):
+3
View File
@@ -251,6 +251,9 @@ class Session(SessionMixin):
resp = history.pop()
resp.history = tuple(history)
# Response manipulation hook.
self.response = dispatch_hook('response', hooks, resp)
return resp