1. Response类型

  • 设置响应的编码格式
# response.encoding = 'utf-8'
# print(response.text)
  • 返回url地址
    # print(response.url)

  • 返回二进制的数据
    # print(response.content)

  • 返回响应的状态码
    # print(response.status_code)

  • 返回的响应头
    print(response.headers)

  • requests_SSL证书验证

import requests 
response = requests.get(url=url,verify=False)
  • 文件上传
files = {'file': open('xxxx.mp4', 'rb')}
response = requests.post(url=url, files=files)
posted on 2024-01-22 10:45  HelloJacker  阅读(5)  评论(0编辑  收藏  举报