使用 COS API 进行 POST 请求时,返回如下异常错误码:
当您使用 COS API 进行 POST 请求出现如下信息时:
<Code>AccessDenied</Code>
<Message>Condition key q-ak doesn't match the value XXXXXX</Message>
q-ak 参数输入错误。
当您使用 COS API 进行 POST 请求出现如下信息时:
<Code>AccessDenied</Code>
<Message>You post object request has been expired, expiration time: 1621188104 but the time now : 1621245817</Message>
Policy 中的 expiration 值已过期。
请修改 Policy 中的 expiration 值。
注意:expiration 值需要晚于当前时间,建议设置为当前时间+30分钟(UTC 时间)。
当您使用 COS API 进行 POST 请求出现如下信息时:
<Code>SignatureDoesNotMatch</Code>
<Message>The Signature you specified is invalid.</Message>
签名计算错误。
请参考 请求签名 文档,检查 POST 签名串生成规则是否正确。
当您使用 COS API 进行 POST 请求出现如下信息时:
<Code>InvalidPolicyDocument</Code>
<Message>You must provide condition if you specify a policy in post object request.</Message>
Policy 格式错误。
请参考 POST Object 文档,将 Policy 格式修改为标准 JSON 格式。
当您使用 COS API 进行 POST 请求出现如下信息时:
<Code>AccessDenied</Code>
<Message>Condition key bucket doesn't match the value [bucket-appid]</Message>
Policy 中的 bucket 与请求 bucket 不一致。
请使用 Policy 中的 bucket 进行请求。
当您使用 COS API 进行 POST 请求出现如下信息时:
<Code>AccessDenied</Code>
<Message>Condition key key doesn't match the value XXXXX</Message>
上传的内容不符合 policy 规则。
根据 Policy 的 Condition,上传符合该条件的内容。
当您使用 COS API 进行 POST 请求出现如下信息时:
<Code>MalformedPOSTRequest</Code>
<Message>The body of your POST request is not well-formed multipart/form-data.</Message>
POST body 格式不符合规范。
参考 POST Object 文档,优化 body 格式。
本页内容是否解决了您的问题?