Skip to content
Myr

response

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 ee6c638 · Browse files · 2 files+4 added−10 removed
This commit

State

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

Diff stats

2 files+4 added−10 removed

  • other:+4 added−10 removed

2 files+4 added−10 removed

modified:requests/hooks.py+1 added-10 removed
6 unmodified lines
7This module provides the capabilities for the Requests hooks system.89Available hooks:1011``pre_request``:12 The Request object, directly after being created.1314``pre_send``:15 The Request object, directly before being sent.1617``post_request``:18 The Request object, directly after being sent.1911``response``:12 The response generated from a Request.1314"""151626HOOKS = ('pre_prepare', 'post_prepare', 'pre_request', 'pre_send', 'post_request', 'response')17HOOKS = ('response')18# TODO: response is the only one1920def dispatch_hook(key, hooks, hook_data):21 """Dispatches a hook dictionary on a given piece of data."""
15 unmodified lines
modified:requests/sessions.py+3 added
249 unmodified lines
250 history.insert(0, resp)251 resp = history.pop()252 resp.history = tuple(history)253254 # Response manipulation hook.255 self.response = dispatch_hook('response', hooks, resp)256257 return resp258259260
90 unmodified lines