在做接口自动化中,很多都会涉及到上传图片或视频

需要注意头文件可变(Content-Type)去掉可变的

接口自动化上传视频(python)

 

需要加上file,我的如下: 

file = {"file": open(r'E:\test.mp4', 'rb'), "Content-Type": "application/octet-stream",
"Content-Disposition": "form-data", "filename": "test.mp4"}
response = requests.post(url, headers=headers, params=params, files=file, verify=False)

接口自动化上传视频(python)

 

相关文章:

  • 2021-09-18
  • 2021-11-20
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
猜你喜欢
  • 2022-12-23
  • 2021-08-01
  • 2021-12-13
  • 2021-11-22
  • 2021-12-04
  • 2021-09-20
  • 2022-12-23
相关资源
相似解决方案