Answers for "python get response headers"

0

python get response headers

import requests

url = "https://www.google.com"
response = requests.head(url)
print(response.headers) # prints the entire header as a dictionary
print(response.headers["Content-Length"]) # prints a specific section of the dictionary
Posted by: Guest on July-21-2021

Code answers related to "python get response headers"

Python Answers by Framework

Browse Popular Code Answers by Language