Skip to content
Myr

Update quickstart.rst

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

Added note about the `json` parameter in `requests.post`.

authored by Smiley Barry · committed by Smiley Barry · parent e3c7b43 · Browse files · 1 file+9 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+9 added−0 removed

  • other:+9 added−0 removed

1 file+9 added−0 removed

modified:docs/user/quickstart.rst+9 added
227 unmodified lines
228 >>> url = 'https://api.github.com/some/endpoint'229 >>> payload = {'some': 'data'}230231 >>> r = requests.post(url, data=json.dumps(payload))232 233You can use the `json` parameter (added in version 2.4.2) to avoid encoding the234data yourself:235236 >>> import json237 >>> url = 'https://api.github.com/some/endpoint'238 >>> payload = {'some': 'data'}239240 >>> r = requests.post(url, json=payload)241242243POST a Multipart-Encoded File244-----------------------------245246Requests makes it simple to upload Multipart-encoded files::
235 unmodified lines