Answers for "request set headers python"

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 request add header

headers_dict = {"Cookie": "cookie1=value1"}
Posted by: Guest on May-18-2021

Python Answers by Framework

Browse Popular Code Answers by Language