Skip to content
Myr

Merge pull request #288 from sharat87/session-arg

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

Add use_session argument to request method.

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 9d8d1d1, a350cef · Browse files · 1 file+4 added−2 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+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:requests/api.py+4 added-2 removed
9 unmodified lines
10:license: ISC, see LICENSE for more details.1112"""1314from .sessions import session14from . import sessions151617def request(method, url,18 params=None,
7 unmodified lines
26 proxies=None,27 hooks=None,28 return_response=True,29 prefetch=False,30 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 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 = session or sessions.session()52 return s.request(53 method=method,54 url=url,55 params=params,
90 unmodified lines