Skip to content
Myr

_return_request => return_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 93c4415 · Browse files · 2 files+6 added−3 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+6 added−3 removed

  • other:+6 added−3 removed

2 files+6 added−3 removed

modified:requests/api.py+5 added-2 removed
15 unmodified lines
16from .status_codes import codes17from .hooks import dispatch_hook18from .utils import cookiejar_from_dict1920from urlparse import urlparse2021__all__ = ('request', 'get', 'head', 'post', 'patch', 'put', 'delete')2223def request(method, url,24 params=None, data=None, headers=None, cookies=None, files=None, auth=None,26 timeout=None, allow_redirects=False, proxies=None, hooks=None):25 timeout=None, allow_redirects=False, proxies=None, hooks=None, return_response=True):2627 """Constructs and sends a :class:`Request <models.Request>`.28 Returns :class:`Response <models.Response>` object.29
36 unmodified lines
6667 # Pre-request hook.68 r = dispatch_hook('pre_request', hooks, r)6970 # Don't send if asked nicely.71 if not return_response:72 return r7374 # Send the HTTP Request.75 r.send()7677 # Post-request hook.
114 unmodified lines
modified:requests/async.py+1 added-1 removed
31 unmodified lines
32def _patched(f):33 """Patches a given API function to not send."""3435 def wrapped(*args, **kwargs):36 return f(*args, _return_request=True, **kwargs)36 return f(*args, return_response=False, **kwargs)3738 return wrapped3940
47 unmodified lines