headers['Transfer-Encoding'] = 'chunked'
This is not explained in user documentation. By going through the source code of requests, I found out that if we set stream=True in requests.get(...) then headers['Transfer-Encoding'] = 'chunked' is set in the HTTP headers. Thus specifying the Chunked transfer encoding. In chunked transfer encoding, the data stream is divided into a series of non-overlapping "chunks". The chunks are sent out independently of one another by the server. Hope this answers the question.
Chunked encoding is useful when larger amounts of data are sent to the client and the total size of the response may not be known until the request has been fully processed. For example, when generating a large HTML table resulting from a database query or when transmitting large images.
当向客户端发送大量数据时,或在请求完全处理之前,可能无法知道响应的总大小的时候,分块编码非常有用。例如,在生成由数据库查询生成的大型HTML表或传输大型图像时。