If I make
r = requests.get('http://github.com', stream=True)
and see in tcpdump, the content of page downloaded just after requests.get. After r.content, no tcpdump transfer activity. The same with requests.Session(stream=True).
Don't use GET if you don't want a response body to be sent by the server. Use a HEAD request instead if all you need is the header information.
All stream=True does is not read the response body from the socket. The server can still initiate sending that body, so the socket receive buffer will already have (some) of that body for Python to read.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With