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
Provenance
- Commit
629d730- Tree
059e920- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
d4eabaa
1 file changed+12 added−37 removed
modified:requests/api.py+12 added-37 removed
53 unmodified lines54 55 return r.response56 57 58-def get(url,59- params=None, headers=None, cookies=None, auth=None, timeout=None,60- proxies=None):58+def get(url, **kwargs):59 60 """Sends a GET request. Returns :class:`Response` object.61 62 :param url: URL for the new :class:`Request` object.4 unmodified lines67 :param timeout: (optional) Float describing the timeout of the request.68 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.69 """70 73- return request('GET', url,74- params=params, headers=headers, cookies=cookies, auth=auth,75- timeout=timeout, proxies=proxies)71+ return request('GET', url, **kwargs)72 73 78-def head(url,79- params=None, headers=None, cookies=None, auth=None, timeout=None,80- proxies=None):74+def head(url, **kwargs):75 76 """Sends a HEAD request. Returns :class:`Response` object.77 78 :param url: URL for the new :class:`Request` object.4 unmodified lines83 :param timeout: (optional) Float describing the timeout of the request.84 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.85 """86 93- return request('HEAD', url,94- params=params, headers=headers, cookies=cookies, auth=auth,95- timeout=timeout, proxies=proxies)87+ return request('HEAD', url, **kwargs)88 89 98-def post(url,99- data='', headers=None, files=None, cookies=None, auth=None, timeout=None,100- allow_redirects=False, params=None, proxies=None):90+def post(url, data='', **kwargs):91 92 """Sends a POST request. Returns :class:`Response` object.93 94 :param url: URL for the new :class:`Request` object.7 unmodified lines102 :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 """105 116- 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)107 108 122-def put(url, data='', headers=None, files=None, cookies=None, auth=None,123- timeout=None, allow_redirects=False, params=None, proxies=None):109+def put(url, data='', **kwargs):110 """Sends a PUT request. Returns :class:`Response` object.111 112 :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 lines120 :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 """123 138- 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)125 126 144-def patch(url, data='', headers=None, files=None, cookies=None, auth=None,145- timeout=None, allow_redirects=False, params=None, proxies=None):127+def patch(url, data='', **kwargs):128 """Sends a PATCH request. Returns :class:`Response` object.129 130 :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 lines138 :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 """141 160- 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)143 144 166-def delete(url,167- params=None, headers=None, cookies=None, auth=None, timeout=None,168- allow_redirects=False, proxies=None):145+def delete(url, **kwargs):146 147 """Sends a DELETE request. Returns :class:`Response` object.148 149 :param url: URL for the new :class:`Request` object.5 unmodified lines155 :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 """158 182- 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)