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

将字符串作为文件发送

Created: November-22, 2018

url = 'http://httpbin.org/post'
files = {'file': ('report.csv', 'some,data,to,send\nanother,row,to,send\n')}
r = requests.post(url, files=files)
r.text
  • 文件上传 w 手动参数

Copyright © 2018. All right reserved

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

  • 关于我们
  • 免责声明