From 3d1444b829f63582b0acb6aa53b82b2693c19213 Mon Sep 17 00:00:00 2001 From: Richard Boulton Date: Thu, 16 Jun 2011 03:18:47 -0700 Subject: [PATCH] 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. --- requests/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requests/api.py b/requests/api.py index 426cfaf..8967c26 100644 --- a/requests/api.py +++ b/requests/api.py @@ -85,7 +85,7 @@ def post(url, data='', headers=None, files=None, cookies=None, auth=None, timeou """Sends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary of POST data to send with the :class:`Request`. + :param data: (optional) Dictionary or bytes of POST data to send with the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`. :param files: (optional) Dictionary of 'filename': file-like-objects for multipart encoding upload. :param cookies: (optional) CookieJar object to send with the :class:`Request`. @@ -102,8 +102,8 @@ def put(url, data='', headers=None, files=None, cookies=None, auth=None, timeout """Sends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. - :param params: (optional) Bytes of PUT Data to send with the :class:`Request`. - :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`. + :param data: (optional) Bytes of PUT Data to send with the :class:`Request`. + :param headers: (optional) Dictionary or bytes of HTTP Headers to sent with the :class:`Request`. :param files: (optional) Dictionary of 'filename': file-like-objects for multipart encoding upload. :param cookies: (optional) CookieJar object to send with the :class:`Request`. :param auth: (optional) AuthObject to enable Basic HTTP Auth. -- 2.34.1