Skip to content
Myr

Tweaked the 'data' param docs to indicate that a file-like object is also supported.

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

authored by Hans Lellelid · committed by Hans Lellelid · parent 0769ee3 · Browse files · 1 file+4 added−4 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+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:requests/api.py+4 added-4 removed
19 unmodified lines
2021 :param method: method for the new :class:`Request` object.22 :param url: URL for the new :class:`Request` object.23 :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.24 :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.24 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.25 :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.26 :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.27 :param files: (optional) Dictionary of 'name': file-like-objects (or {'name': ('filename', fileobj)}) for multipart encoding upload.28 :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.
44 unmodified lines
73def post(url, data=None, **kwargs):74 """Sends a POST request. Returns :class:`Response` object.7576 :param url: URL for the new :class:`Request` object.77 :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.77 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.78 :param \*\*kwargs: Optional arguments that ``request`` takes.79 """8081 return request('post', url, data=data, **kwargs)
2 unmodified lines
84def put(url, data=None, **kwargs):85 """Sends a PUT request. Returns :class:`Response` object.8687 :param url: URL for the new :class:`Request` object.88 :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.88 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.89 :param \*\*kwargs: Optional arguments that ``request`` takes.90 """9192 return request('put', url, data=data, **kwargs)
2 unmodified lines
95def patch(url, data=None, **kwargs):96 """Sends a PATCH request. Returns :class:`Response` object.9798 :param url: URL for the new :class:`Request` object.99 :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.99 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.100 :param \*\*kwargs: Optional arguments that ``request`` takes.101 """102103 return request('patch', url, data=data, **kwargs)
10 unmodified lines