demo_requests_get_stream.py:
import requests url = 'https://begtut.com/images/pulpit.jpg' #allow the response to be streamed by setting the 'stream' parameter to True: x = requests.get(url, stream=True) print(x.status_code)
➜ begtut>python demo_requests_get_stream.py
200