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

  • 關於本站
  • 免責聲明