Skip to content
Myr

all main functions are **kwargs now. People shouldn't be relying on the order.

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 d4eabaa · Browse files · 1 file+12 added−37 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+12 added−37 removed

  • other:+12 added−37 removed

1 file+12 added−37 removed

modified:requests/api.py+12 added-37 removed
53 unmodified lines
5455 return r.response565758def get(url,59 params=None, headers=None, cookies=None, auth=None, timeout=None,60 proxies=None):58def get(url, **kwargs):5960 """Sends a GET request. Returns :class:`Response` object.6162 :param url: URL for the new :class:`Request` object.
4 unmodified lines
67 :param timeout: (optional) Float describing the timeout of the request.68 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.69 """7073 return request('GET', url,74 params=params, headers=headers, cookies=cookies, auth=auth,75 timeout=timeout, proxies=proxies)71 return request('GET', url, **kwargs)727378def head(url,79 params=None, headers=None, cookies=None, auth=None, timeout=None,80 proxies=None):74def head(url, **kwargs):7576 """Sends a HEAD request. Returns :class:`Response` object.7778 :param url: URL for the new :class:`Request` object.
4 unmodified lines
83 :param timeout: (optional) Float describing the timeout of the request.84 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.85 """8693 return request('HEAD', url,94 params=params, headers=headers, cookies=cookies, auth=auth,95 timeout=timeout, proxies=proxies)87 return request('HEAD', url, **kwargs)888998def post(url,99 data='', headers=None, files=None, cookies=None, auth=None, timeout=None,100 allow_redirects=False, params=None, proxies=None):90def post(url, data='', **kwargs):9192 """Sends a POST request. Returns :class:`Response` object.9394 :param url: URL for the new :class:`Request` object.
7 unmodified lines
102 :param params: (optional) Dictionary of parameters, or bytes, to be sent in the query string for the :class:`Request`.103 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.104 """105116 return request('POST', url,117 params=params, data=data, headers=headers, files=files,118 cookies=cookies, auth=auth, timeout=timeout,119 allow_redirects=allow_redirects, proxies=proxies)106 return request('POST', url, data=data, **kwargs)107108122def put(url, data='', headers=None, files=None, cookies=None, auth=None,123 timeout=None, allow_redirects=False, params=None, proxies=None):109def put(url, data='', **kwargs):110 """Sends a PUT request. Returns :class:`Response` object.111112 :param url: URL for the new :class:`Request` object.113 :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
6 unmodified lines
120 :param params: (optional) Dictionary of parameters, or bytes, to be sent in the query string for the :class:`Request`.121 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.122 """123138 return request('PUT', url,139 params=params, data=data, headers=headers, files=files,140 cookies=cookies, auth=auth, timeout=timeout,141 allow_redirects=allow_redirects, proxies=proxies)124 return request('PUT', url, data=data, **kwargs)125126144def patch(url, data='', headers=None, files=None, cookies=None, auth=None,145 timeout=None, allow_redirects=False, params=None, proxies=None):127def patch(url, data='', **kwargs):128 """Sends a PATCH request. Returns :class:`Response` object.129130 :param url: URL for the new :class:`Request` object.131 :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.
6 unmodified lines
138 :param params: (optional) Dictionary of parameters, or bytes, to be sent in the query string for the :class:`Request`.139 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.140 """141160 return request('PATCH', url,161 params=params, data=data, headers=headers, files=files,162 cookies=cookies, auth=auth, timeout=timeout,163 allow_redirects=allow_redirects, proxies=proxies)142 return request('PATCH', url, **kwargs)143144166def delete(url,167 params=None, headers=None, cookies=None, auth=None, timeout=None,168 allow_redirects=False, proxies=None):145def delete(url, **kwargs):146147 """Sends a DELETE request. Returns :class:`Response` object.148149 :param url: URL for the new :class:`Request` object.
5 unmodified lines
155 :param allow_redirects: (optional) Boolean. Set to True if redirect following is allowed.156 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.157 """158182 return request('DELETE', url,183 params=params, headers=headers, cookies=cookies, auth=auth,184 timeout=timeout, allow_redirects=allow_redirects, proxies=proxies)159 return request('DELETE', url, **kwargs)