使用python库为多部分文件上载重置连接

使用python库为多部分文件上载重置连接,python,python-requests,Python,Python Requests,我正在尝试编写一个脚本来执行一系列rest调用。我有两个文件上传电话 a) 文件大小为1.6M b) 文件大小为113M 第二次调用失败,并显示一条消息“由对等方重置连接”。下面是文件上载代码的一个片段 import requests auth_headers={'X-MW-Token':auth_token,'Connection':'keep-alive','Content-Type':'multipart/form-data'} upload_url='https://foo.ba

我正在尝试编写一个脚本来执行一系列rest调用。我有两个文件上传电话 a) 文件大小为1.6M b) 文件大小为113M

第二次调用失败,并显示一条消息“由对等方重置连接”。下面是文件上载代码的一个片段

import requests  


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
如果文件大小很大,是否有明确的措施要做