mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge remote-tracking branch 'upstream/master' into proposed/2.8.0
This commit is contained in:
@@ -268,13 +268,19 @@ Requests also supports Chunked transfer encoding for outgoing and incoming reque
|
||||
To send a chunk-encoded request, simply provide a generator (or any iterator without
|
||||
a length) for your body::
|
||||
|
||||
|
||||
def gen():
|
||||
yield 'hi'
|
||||
yield 'there'
|
||||
|
||||
requests.post('http://some.url/chunked', data=gen())
|
||||
|
||||
For chunked encoded responses, it's best to iterate over the data using
|
||||
:meth:`Response.iter_content() <requests.models.Response.iter_content>`. In
|
||||
an ideal situation you'll have set ``stream=True`` on the request, in which
|
||||
case you can iterate chunk-by-chunk by calling ``iter_content`` with a chunk
|
||||
size parameter of ``None``. If you want to set a maximum size of the chunk,
|
||||
you can set a chunk size parameter to any integer.
|
||||
|
||||
|
||||
.. _multipart:
|
||||
|
||||
|
||||
@@ -1292,13 +1292,6 @@ class TestCaseInsensitiveDict(unittest.TestCase):
|
||||
cid['changed'] = True
|
||||
assert cid != cid_copy
|
||||
|
||||
def test_repr(self):
|
||||
cid = CaseInsensitiveDict({
|
||||
'Accept': 'application/json',
|
||||
'user-Agent': 'requests',
|
||||
})
|
||||
assert repr(cid) == "{'Accept': 'application/json', 'user-Agent': 'requests'}"
|
||||
|
||||
|
||||
class UtilsTestCase(unittest.TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user