Skip to content
Myr

Add use_session argument to request method.

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

This allows usage of an existing session to make a request with the request and the get, post etc. function.

authored by Shrikant Sharat · committed by Shrikant Sharat · parent 9d8d1d1 · Browse files · 1 file+3 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+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:requests/api.py+3 added-1 removed
25 unmodified lines
26 proxies=None,27 hooks=None,28 return_response=True,29 prefetch=False,30 use_session=None,31 config=None):32 """Constructs and sends a :class:`Request <Request>`.33 Returns :class:`Response <Response>` object.34
8 unmodified lines
43 :param timeout: (optional) Float describing the timeout of the request.44 :param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.45 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.46 :param return_response: (optional) If False, an un-sent Request object will returned.47 :param use_session: (optional) A :class:`Session` object to be used for the request.48 :param config: (optional) A configuration dictionary.49 """5049 s = session()51 s = use_session or session()52 return s.request(53 method=method,54 url=url,55 params=params,
90 unmodified lines