使用请求python库重置多部分文件的连接重置

时间:2015-04-10 17:07:35

标签: python python-requests

我正在尝试编写一个脚本来进行一堆休息调用。我有两个文件上传调用 a)文件大小为1.6M b)文件大小为113M

第二次呼叫失败,并显示一条消息"由对等方重置连接"。以下是文件上传代码的片段

auth_headers={'X-MW-Token':auth_token,'Connection':'keep-alive','Content-Type':'multipart/form-data'}
upload_url='https://foo.bar.com/uw/upload/s_file_upload'
files = {'file':('m.support',open('m.support','rb'),'application/octet-stream')}
r = requests.post(upload_url,files=files,headers=auth_headers,verify=False)
print r.status_code
print r.text

如果文件大小很大,有没有明确要做的事情?

0 个答案:

没有答案
相关问题