Skip to content
Myr

Merge pull request #2680 from peplin/patch-1

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

Fix docs for passing a list of values for a query string

authored by Cory Benfield · committed by Cory Benfield · parents b4c1fea, 6648def · Browse files · 1 file+3 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+3 added−4 removed

  • other:+3 added−4 removed

1 file+3 added−4 removed

modified:docs/user/quickstart.rst+3 added-4 removed
71 unmodified lines
7273Note that any dictionary key whose value is ``None`` will not be added to the74URL's query string.7576In order to pass a list of items as a value you must mark the key as77referring to a list like string by appending ``[]`` to the key::76You can also pass a list of items as a value::7779 >>> payload = {'key1': 'value1', 'key2[]': ['value2', 'value3']}78 >>> payload = {'key1': 'value1', 'key2': ['value2', 'value3']}79 >>> r = requests.get("http://httpbin.org/get", params=payload)80 >>> print(r.url)82 http://httpbin.org/get?key1=value1&key2%5B%5D=value2&key2%5B%5D=value381 http://httpbin.org/get?key1=value1&key2=value2&key2=value38283Response Content84----------------85
386 unmodified lines