Skip to content
Myr

simplify api.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 31d495f · Browse files · 1 file+2 added−32 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+2 added−32 removed

  • other:+2 added−32 removed

1 file+2 added−32 removed

modified:requests/api.py+2 added-32 removed
11 unmodified lines
12"""1314from . import sessions1516def request(method, url,17 params=None,18 data=None,19 headers=None,20 cookies=None,21 files=None,22 auth=None,23 timeout=None,24 allow_redirects=False,25 proxies=None,26 hooks=None,27 return_response=True,28 prefetch=False,29 session=None,30 config=None):16def request(method, url, **kwargs):17 """Constructs and sends a :class:`Request <Request>`.18 Returns :class:`Response <Response>` object.1920 :param method: method for the new :class:`Request` object.
12 unmodified lines
33 :param config: (optional) A configuration dictionary.34 """3536 s = session or sessions.session()51 return s.request(52 method=method,53 url=url,54 params=params,55 data=data,56 headers=headers,57 cookies=cookies,58 files=files,59 auth=auth,60 timeout=timeout,61 allow_redirects=allow_redirects,62 proxies=proxies,63 hooks=hooks,64 return_response=return_response,65 config=config,66 prefetch=prefetch67 )37 return s.request(method=method, url=url, **kwargs)38394041def get(url, **kwargs):
73 unmodified lines