获取您自己的
Python
服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
import requests #the required first parameter of the 'head' method is the 'url': x = requests.head('https://w3schools.org.cn/python/demopage.php') #print the response headers (the HTTP headers of the requested file): print(x.headers)
{'Content-Encoding': 'gzip', 'Cache-Control': 'public', 'Content-Type': 'text/html', 'Date': '', 'Server': 'Microsoft-IIS/7.5', 'Vary': 'Accept-Encoding', 'X-Frame-Options': 'SAMEORIGIN', 'X-Powered-By': 'PHP/5-4-2. ASP.NET', 'Content-Length': '0'}