我尝试使用
m = MultipartEncoder(fields={
'file': (os.path.basename(filepath), open(filepath, 'rb'), "image/jpeg")
})
html = requests.post(
'http://221.226.86.226:9012/nyqc/material/up.action?type=2&ftype=0&relationId=338&bussiId=20190313162759510770&flowNum=&uploadType=',
headers={
'Content-Type':
m.content_type,
'Cookie':
'JSESSIONID=0770696F2B043103883B2DA46D465BDC',
'Host':
'221.226.86.226:9012',
'Referer':
'http://221.226.86.226:9012/nyqc//js/plupload/plupload.flash.swf',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko'
},
data=m,
timeout=10)
和
html = requests.post(
'http://221.226.86.226:9012/nyqc/material/up.action?type=2&ftype=0&relationId=338&bussiId=20190313162759510770&flowNum=&uploadType=',
headers={
'Cookie':
'JSESSIONID=0770696F2B043103883B2DA46D465BDC',
'Host':
'221.226.86.226:9012',
'Referer':
'http://221.226.86.226:9012/nyqc//js/plupload/plupload.flash.swf',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko'
},
files={'file': open(filepath, 'rb')},
timeout=10)
可以返回成功消息({“ status”:true,“ newName”:“ null”}),但未加载任何文件。