Skip to content

Commit d85e1b8

Browse files
committed
docs: clarify Quickstart POST example (fixes #6949)
1 parent 7341690 commit d85e1b8

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

docs/user/quickstart.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Note: All header values must be a ``string``, bytestring, or unicode. While perm
233233
More complicated POST requests
234234
------------------------------
235235

236-
Typically, you want to send some form-encoded data much like an HTML form.
236+
Typically, you want to send some form-encoded data - much like an HTML form.
237237
To do this, simply pass a dictionary to the ``data`` argument. Your
238238
dictionary of data will automatically be form-encoded when the request is made::
239239

@@ -270,7 +270,9 @@ use the same key::
270270
},
271271
...
272272
}
273-
>>> r1.text == r2.text
273+
>>> # NOTE: httpbin.org injects an "X-Amzn-Trace-Id" header in its JSON response,
274+
>>> # so r1.text and r2.text may differ even though they carry identical form data.
275+
>>> r1.json()['form'] == r2.json()['form']
274276
True
275277

276278
There are times that you may want to send data that is not form-encoded. If
@@ -290,7 +292,7 @@ Please note that the above code will NOT add the ``Content-Type`` header
290292

291293
If you need that header set and you don't want to encode the ``dict`` yourself,
292294
you can also pass it directly using the ``json`` parameter (added in version 2.4.2)
293-
and it will be encoded automatically:
295+
and it will be encoded automatically::
294296

295297
>>> url = 'https://api.github.com/some/endpoint'
296298
>>> payload = {'some': 'data'}

0 commit comments

Comments
 (0)