1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| // 获取响应正文 response.text
// 获取响应正文(以二进制方式) response.content
// 获取/修改响应编码 response.encoding response.encoding=
// 获取响应状态码 response.status_code
// 获取响应头 response.headers
// 获取请求URL response.url
// 获取请求头 request.headers
// 获取历史响应(查看重定向之前的响应) response.history
// 获取Cookies信息 response.cookies
// json格式字符串转换成python字典 response.json()
// 原始套接字响应 response.raw/.raw.read
// 抛出异常 response.raise_for_status()
// 身份验证 response.auth=
// 解析连接字头 response.links[]
|