Skip to content
Myr

quickstart: using a list as a value in query params

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

authored by Tom S · committed by Tom S · parent 69b7c45 · Browse files · 1 file+7 added−0 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+7 added−0 removed

  • other:+7 added−0 removed

1 file+7 added−0 removed

modified:docs/user/quickstart.rst+7 added
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::7879 >>> payload = {'key1': 'value1', 'key2[]': ['value2', 'value3']}80 >>> r = requests.get("http://httpbin.org/get", params=payload)81 >>> print(r.url)82 http://httpbin.org/get?key1=value1&key2%5B%5D=value2&key2%5B%5D=value38384Response Content85----------------8687We can read the content of the server's response. Consider the GitHub timeline
368 unmodified lines