📜  python 获取响应标头 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:56.251000             🧑  作者: Mango

代码示例1
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