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

  • 關於本站
  • 免責聲明