Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #response #headers
ADD COMMENT
Topic
Name
6+4 =