Skip to content

Commit 6c1f20e

Browse files
E8Pricenateprewitt
authored andcommitted
docs: clarify Quickstart POST example (fixes #6949)
1 parent b2a1d33 commit 6c1f20e

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
@@ -234,7 +234,7 @@ Note: All header values must be a ``string``, bytestring, or unicode. While perm
234234
More complicated POST requests
235235
------------------------------
236236

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

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

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

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

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

0 commit comments

Comments
 (0)