Skip to content
Myr

Conform api.* arguments to api.request arguments.

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

Fixes #40. Fixes #41.

authored by Johannes · committed by Johannes · parent 7e3d265 · Browse files · 1 file+16 added−10 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+16 added−10 removed

  • other:+16 added−10 removed

1 file+16 added−10 removed

modified:requests/api.py+16 added-10 removed
51 unmodified lines
52 r.send()5354 return r.response5556def get(url, params={}, headers={}, cookies=None, auth=None, **kwargs):56def get(url, params=None, headers=None, cookies=None, auth=None, timeout=None):57 """Sends a GET request. Returns :class:`Response` object.5859 :param url: URL for the new :class:`Request` object.60 :param params: (optional) Dictionary of GET Parameters to send with the :class:`Request`.
2 unmodified lines
63 :param auth: (optional) AuthObject to enable Basic HTTP Auth.64 :param timeout: (optional) Float describing the timeout of the request.65 """6667 return request('GET', url, params=params, headers=headers, cookies=cookies, auth=auth, **kwargs)67 return request('GET', url, params=params, headers=headers, cookies=cookies, auth=auth, timeout=timeout)686970def head(url, params={}, headers={}, cookies=None, auth=None, **kwargs):70def head(url, params=None, headers=None, cookies=None, auth=None, timeout=None):71 """Sends a HEAD request. Returns :class:`Response` object.7273 :param url: URL for the new :class:`Request` object.74 :param params: (optional) Dictionary of GET Parameters to send with the :class:`Request`.
2 unmodified lines
77 :param auth: (optional) AuthObject to enable Basic HTTP Auth.78 :param timeout: (optional) Float describing the timeout of the request.79 """8081 return request('HEAD', url, params=params, headers=headers, cookies=cookies, auth=auth, **kwargs)81 return request('HEAD', url, params=params, headers=headers, cookies=cookies, auth=auth, timeout=timeout)828384def post(url, data={}, headers={}, files=None, cookies=None, auth=None, **kwargs):84def post(url, data=None, headers=None, files=None, cookies=None, auth=None, timeout=None, allow_redirects=False):85 """Sends a POST request. Returns :class:`Response` object.8687 :param url: URL for the new :class:`Request` object.88 :param data: (optional) Dictionary of POST data to send with the :class:`Request`.
1 unmodified line
90 :param files: (optional) Dictionary of 'filename': file-like-objects for multipart encoding upload.91 :param cookies: (optional) CookieJar object to send with the :class:`Request`.92 :param auth: (optional) AuthObject to enable Basic HTTP Auth.93 :param timeout: (optional) Float describing the timeout of the request.94 :param allow_redirects: (optional) Boolean. Set to True if redirect following is allowed.95 """9696 return request('POST', url, data=data, headers=headers, files=files, cookies=cookies, auth=auth, **kwargs)97 return request('POST', url, data=data, headers=headers, files=files, cookies=cookies, auth=auth,98 timeout=timeout, allow_redirects=allow_redirects)9910099def put(url, data='', headers={}, files={}, cookies=None, auth=None, **kwargs):101def put(url, data=None, headers=None, files=None, cookies=None, auth=None, timeout=None, allow_redirects=False):102 """Sends a PUT request. Returns :class:`Response` object.103104 :param url: URL for the new :class:`Request` object.105 :param params: (optional) Bytes of PUT Data to send with the :class:`Request`.
1 unmodified line
107 :param files: (optional) Dictionary of 'filename': file-like-objects for multipart encoding upload.108 :param cookies: (optional) CookieJar object to send with the :class:`Request`.109 :param auth: (optional) AuthObject to enable Basic HTTP Auth.110 :param timeout: (optional) Float describing the timeout of the request.111 :param allow_redirects: (optional) Boolean. Set to True if redirect following is allowed.112 """113111 return request('PUT', url, data=data, headers=headers, files=files, cookies=cookies, auth=auth, **kwargs)114 return request('PUT', url, data=data, headers=headers, files=files, cookies=cookies, auth=auth,115 timeout=timeout, allow_redirects=allow_redirects)116117114def delete(url, params={}, headers={}, cookies=None, auth=None, **kwargs):118def delete(url, params=None, headers=None, cookies=None, auth=None, timeout=None, allow_redirects=False):119 """Sends a DELETE request. Returns :class:`Response` object.120121 :param url: URL for the new :class:`Request` object.122 :param params: (optional) Dictionary of DELETE Parameters to send with the :class:`Request`.123 :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.124 :param cookies: (optional) CookieJar object to send with the :class:`Request`.125 :param auth: (optional) AuthObject to enable Basic HTTP Auth.126 :param timeout: (optional) Float describing the timeout of the request.127 :param allow_redirects: (optional) Boolean. Set to True if redirect following is allowed.128 """129125 return request('DELETE', url, params=params, headers=headers, cookies=cookies, auth=auth, **kwargs)130 return request('DELETE', url, params=params, headers=headers, cookies=cookies, auth=auth,131 timeout=timeout, allow_redirects=allow_redirects)