Answers for "how to get specific headers python request"

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
0

python send get request with headers

r=requests.get("http://www.example.com/", headers={"content-type":"text"})
Posted by: Guest on November-16-2020

Code answers related to "how to get specific headers python request"

Python Answers by Framework

Browse Popular Code Answers by Language