From 6648defcddeff2e5e4022f51a9fd7b6c224bc472 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Sat, 18 Jul 2015 18:50:29 -0400 Subject: [PATCH] Fix docs for passing a list of values for a query string The special `[]` notation at the end of the field name is not necessary to get a field to appear with multiple values in the query string. --- docs/user/quickstart.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index cac4ace0..42202648 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -73,13 +73,12 @@ You can see that the URL has been correctly encoded by printing the URL:: Note that any dictionary key whose value is ``None`` will not be added to the URL's query string. -In order to pass a list of items as a value you must mark the key as -referring to a list like string by appending ``[]`` to the key:: +You can also pass a list of items as a value:: - >>> payload = {'key1': 'value1', 'key2[]': ['value2', 'value3']} + >>> payload = {'key1': 'value1', 'key2': ['value2', 'value3']} >>> r = requests.get("http://httpbin.org/get", params=payload) >>> print(r.url) - http://httpbin.org/get?key1=value1&key2%5B%5D=value2&key2%5B%5D=value3 + http://httpbin.org/get?key1=value1&key2=value2&key2=value3 Response Content ----------------