【发布时间】:2013-11-01 19:06:07
【问题描述】:
我正在尝试使用 python 请求上传我的大文件(大约 1 gb),但它没有流式传输 - 将其加载到内存中。
with open('file.rar','rb') as ff:
upload = requests.post(host,files={"file": ff})
正如文档所说,我试过了:
with open('file.rar','rb') as ff:
upload = requests.post(host,data=ff)
及其工作,但我需要修改其他 POST 字段。如何在 python-requests 中做到这一点?
【问题讨论】:
-
我在这里遇到了完全相同的问题。