我使用 python 请求通过 PUT 方法上传文件。
仅当正文包含属性 Content-Type:i mage/png not as Request Header 时,远程 API 才接受任何请求
当我使用 python 请求时,请求被拒绝,因为缺少属性
我尝试使用代理,在添加了缺少的属性后,它被接受了
查看突出显示的文本
但我不能以编程方式添加它,我该怎么做?
这是我的代码:
files = {'location[logo]': open(fileinput,'rb')}
ses = requests.session()
res = ses.put(url=u,files=files,headers=myheaders,proxies=proxdic)
Run Code Online (Sandbox Code Playgroud)