Skip to content
Myr

Update documentation of the "data" parameter for requests.post() to indicate that it allows bytes. Update documentation of requests.put() to refer to the "data" parameter rather than the (hidden, but functional) "params" parameter, and note that that also allows both bytes and dictionaries.

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

authored by Richard Boulton · committed by Richard Boulton · parent 4d3a9de · Browse files · 1 file+3 added−3 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+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:requests/api.py+3 added-3 removed
83 unmodified lines
84def post(url, data='', 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`.88 :param data: (optional) Dictionary or bytes of POST data to send with the :class:`Request`.89 :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.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.
8 unmodified lines
101def put(url, data='', 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`.106 :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.105 :param data: (optional) Bytes of PUT Data to send with the :class:`Request`.106 :param headers: (optional) Dictionary or bytes of HTTP Headers to sent with the :class:`Request`.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.
21 unmodified lines