Skip to content

Commit

Permalink
Document that 'params' can also be a list of tuples
Browse files Browse the repository at this point in the history
Like we just did for 'data', 'params' follows the same processing and
can also be a list of tuples.
  • Loading branch information
moy committed Jul 17, 2018
1 parent 2d1b448 commit c008bf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions requests/api.py
Expand Up @@ -18,7 +18,8 @@ def request(method, url, **kwargs):
:param method: method for the new :class:`Request` object.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
:param params: (optional) Dictionary, list of tuples or bytes to send
in the body of the :class:`Request`.

This comment has been minimized.

Copy link
@mjpieters

mjpieters Dec 13, 2018

Contributor

Oops, this is not correct any more. Note how you changed the params documentation from to be sent in the query string to in the body of. Copy and paste error?

To be explicit: params still go in the query string, not the request body.

:param data: (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the :class:`Request`.
:param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`.
Expand Down Expand Up @@ -63,7 +64,8 @@ def get(url, params=None, **kwargs):
r"""Sends a GET request.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
:param params: (optional) Dictionary, list of tuples or bytes to send
in the body of the :class:`Request`.

This comment has been minimized.

Copy link
@mjpieters

mjpieters Dec 13, 2018

Contributor

Ditto here.

:param \*\*kwargs: Optional arguments that ``request`` takes.
:return: :class:`Response <Response>` object
:rtype: requests.Response
Expand Down
4 changes: 3 additions & 1 deletion requests/models.py
Expand Up @@ -208,7 +208,9 @@ class Request(RequestHooksMixin):
list of tuples ``[(key, value)]`` is provided, form-encoding will
take place.
:param json: json for the body to attach to the request (if files or data is not specified).
:param params: dictionary of URL parameters to append to the URL.
:param params: URL parameters to append to the URL. If a dictionary or
list of tuples ``[(key, value)]`` is provided, form-encoding will
take place.
:param auth: Auth handler or (user, pass) tuple.
:param cookies: dictionary or CookieJar of cookies to attach to this request.
:param hooks: dictionary of callback hooks, for internal usage.
Expand Down

1 comment on commit c008bf3

@mjpieters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit should be corrected, params documentation is now factually incorrect.

Please sign in to comment.