python flask 将post获取到的文件传到另一个网站
fname=list(request.files)[0] f=request.files[fname] #f.save(srctmp) #stream=open(srctmp,"rb") stream=f.stream url = 'https://xxxxxx/UploadAttachment' fields={"category":"1","refKey":"WX"} files = {'file':(f.filename, stream)} r = requests.post(url,data=fields,verify=False, files=files)