demo_requests_response_reason.py:
import requests url = 'https://www.begtut.com/python/demopage.htm' x = requests.get(url) print(x.reason)
➜ begtut>python demo_requests_response_reason.py
OK