logo
  • 教程列表
  • SO官方文档
  • 档
    • 简单文件上传
    • 文件上传 w 手动参数
    • 将字符串作为文件发送
  1. StackOverflow 文档
  2. python-requests 教程
  3. 档
  4. 文件上传 w 手动参数

文件上传 w 手动参数

Created: November-22, 2018

url = 'http://httpbin.org/post'
files = {'file': ('report.xls', open('report.xls', 'rb'), 'application/vnd.ms-excel', {'Expires': '0'})}
r = requests.post(url, files=files)
  • 将字符串作为文件发送
  • 简单文件上传

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明