Closed qzwzqty closed 1 year ago
遇到一样的错误,是 ContentType: multipart/form-data, boundary=9431149156168 写错了
正常是 ContentType: multipart/form-data; boundary=9431149156168
另外也不支持 Content-Type: multipart/form-data; charset=utf-8; boundary=X_PAW_BOUNDARY 设置 charset
@StringKe 多谢多谢,我试试看
@StringKe 大佬,你好,我现在遇到另一个问题了,大佬有空帮我看看,谢了。
<Error>
<Code>MalformedPOSTRequest</Code>
<Message>The body of your POST request is not well-formed multipart/form-data</Message>
<RequestId>64C882A48C0B5C37379B15EB</RequestId>
<HostId>zhjx-test.oss-cn-beijing.aliyuncs.com</HostId>
<EC>0006-00000109</EC>
</Error>
表单:
POST https://xxxx.oss-cn-beijing.aliyuncs.com/ HTTP/1.1
Host: zhjx-test.oss-cn-beijing.aliyuncs.com
Accept: application/json
Content-Type: multipart/form-data; boundary="9431149156168"
Content-Length: 151432
--9431149156168
Content-Disposition: form-data; name="success_action_status"
201
--9431149156168
Content-Disposition: form-data; name="OssAccessKeyId"
LTxxxx
--9431149156168
Content-Disposition: form-data; name="key"
xxxx/xxxx
--9431149156168
Content-Disposition: form-data; name="policy"
xxxx
--9431149156168
Content-Disposition: form-data; name="signature"
xxxx
--9431149156168
Content-Type: image/jpge
Content-Disposition: form-data; name="file"; filename=testfilename.jpg; filename*=utf-8''testfilename.jpg
卧槽,我知道怎么回事了,Content-Type: image/jpge 要去掉,Content-Disposition: form-data; name="file"; filename=testfilename.jpg; filename*=utf-8''testfilename.jpg 改为:Content-Disposition: form-data; name="file"; filename="testfilename.jpg"
生成的表单:
返回的错误:
谢谢。