Skip to content
Myr

pass hooks around, disable auto send request.

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 2f50081 · Browse files · 1 file+7 added−1 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+7 added−1 removed

  • other:+7 added−1 removed

1 file+7 added−1 removed

modified:requests/api.py+7 added-1 removed
22 unmodified lines
2324def request(method, url,25 params=None, data=None, headers=None, cookies=None, files=None, auth=None,26 timeout=None, allow_redirects=False, proxies=None, hooks=None,27 config=None, _pools=None):27 config=None, _pools=None, _return_request=False):2829 """Constructs and sends a :class:`Request <Request>`.30 Returns :class:`Response <Response>` object.31
33 unmodified lines
65 cookies=cookies,66 files=files,67 auth=auth,68 timeout=timeout or config.get('timeout'),69 hooks=hooks,70 allow_redirects=allow_redirects,71 proxies=proxies or config.get('proxies'),72 _pools=_pools73 )
6 unmodified lines
8081 # Pre-request hook.82 r = dispatch_hook('pre_request', hooks, r)8384 # Only construct the request (for async)85 if _return_request:86 return r8788 # Send the HTTP Request.89 r.send()9091 # TODO: Add these hooks inline.92 # Post-request hook.93 r = dispatch_hook('post_request', hooks, r)9495 # Response manipulation hook.
72 unmodified lines