Skip to content
Myr

Merge remote-tracking branch 'upstream/master' into proposed/2.8.0

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

authored by Ian Cordasco · committed by Ian Cordasco · parents 31817b6, b4c1fea · Browse files · 2 files+7 added−8 removed
This commit

State

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

Diff stats

2 files+7 added−8 removed

  • other:+7 added−8 removed

2 files+7 added−8 removed

modified:docs/user/advanced.rst+7 added-1 removed
266 unmodified lines
267Requests also supports Chunked transfer encoding for outgoing and incoming requests.268To send a chunk-encoded request, simply provide a generator (or any iterator without269a length) for your body::270271271 def gen():272 yield 'hi'273 yield 'there'274275 requests.post('http://some.url/chunked', data=gen())276277For chunked encoded responses, it's best to iterate over the data using278:meth:`Response.iter_content() <requests.models.Response.iter_content>`. In279an ideal situation you'll have set ``stream=True`` on the request, in which280case you can iterate chunk-by-chunk by calling ``iter_content`` with a chunk281size parameter of ``None``. If you want to set a maximum size of the chunk,282you can set a chunk size parameter to any integer.283284285.. _multipart:286287POST Multiple Multipart-Encoded Files288-------------------------------------
543 unmodified lines
modified:test_requests.py-7 removed
1290 unmodified lines
1291 assert cid == cid_copy1292 cid['changed'] = True1293 assert cid != cid_copy12941295 def test_repr(self):1296 cid = CaseInsensitiveDict({1297 'Accept': 'application/json',1298 'user-Agent': 'requests',1299 })1300 assert repr(cid) == "{'Accept': 'application/json', 'user-Agent': 'requests'}"129513021296class UtilsTestCase(unittest.TestCase):12971298 def test_super_len_io_streams(self):1299 """ Ensures that we properly deal with different kinds of IO streams. """
390 unmodified lines