demo_requests_response_headers.py:
import requests url = 'https://w3schools.com/python/demopage.htm' x = requests.get(url) print(x.headers)
C:\Users\My Name>python demo_requests_response_headers.py
{'Content-Encoding': 'gzip', 'Accept-Ranges': 'bytes', Cache-Control': 'public.max-age=14400,public', 'Content-Type': 'text/html', 'Date': '', 'Etag': '"1bb34548c7151:0"', 'Last-Modified': 'Tue, 04 Jun 2019 11:18:49 GMT', 'Server': 'ECS (ska/F719)', 'Vary': 'Accept-Encoding', 'X-Cache': 'HIT', 'X-Frame-Options': 'SAMEORIGIN', 'X-Powered-By': 'ASP.NET', 'Content-Length': 178'}