requests发送HTTP请求后返回的响应头
requests 返回的Response对象包含响应头属性 headers:
response.headers
访问 Response.headers 属性会返回一个字典,但这个字典有点与众不同;
因为 HTTP头部是大小写不敏感的,我们可以使用任意大小的形式作为键来访问这个字典:
response.headers['Content-Type']
response.headers.get('content-type')
转载声明
本文版权归作者所有
如需转载,请注明出处;本文地址: https://www.perfcode.com/p/requests-response-headers.html