Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does stream=true do?

What does stream = true do? I couldn't find anything on the web but I suppose that it have something to do with the memory?

requests.get('https://...com', stream=True)
like image 446
Nikolass Avatar asked Oct 21 '25 13:10

Nikolass


2 Answers

Using stream=True sets the stage for you to read the response data in chunks as opposed to having the entire response body downloaded in one go upfront.

See https://docs.python-requests.org/en/latest/user/advanced/#body-content-workflow for more info.

like image 119
Amal Avatar answered Oct 23 '25 02:10

Amal


stream = True means "At this point only the response headers have been downloaded and the connection remains open until we access the Response.content"

https://requests.readthedocs.io/en/latest/user/advanced/#body-content-workflow

like image 27
nathannnnn Avatar answered Oct 23 '25 03:10

nathannnnn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!