python 处理form/data文件上传


处理multipart/form-data 的java serverlet请求接口通过python实现
记住不要在头加:"Content-Type":"multipart/form-data"不然会报错

import requests
dt={"file":{},"message": "duotou","hashType": "md5","statMonth":"201910","version":"1","jobId":""}

url = "http://localhost/api/v1/recall/relater"


file={'file': open("./20191011.csv", 'rb')}

head={"app_id": "100031",
"seqno":"test200811230011"}
response = requests.request("POST", url, data=dt, headers=head,files=file)

print(response.text)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM