kct*_*ang 12 java google-cloud-storage
我正在尝试使用"已签名的网址"来访问/上传文件到Google云端存储(GCS).
按照https://developers.google.com/storage/docs/accesscontrol#Signing-Strings中的说明操作
我做了什么:
但是,我仍然得到这个(状态:403 Forbidden):
<?xml version='1.0' encoding='UTF-8'?>
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.</Message>
<StringToSign>PUT
text/plain
1384084959392
x-goog-api-version:2
x-goog-project-id:99999
/mybucket/myfile.txt</StringToSign>
</Error>
Run Code Online (Sandbox Code Playgroud)
即使我根据"StringToSign"中的值对字符串进行重试,我仍然会得到相同的错误.
在这里阅读各种相关的帖子,但找不到任何解决方案,其中大部分是指x-goog-api-version:1我在使用版本2时.
我错过了什么?任何帮助将不胜感激.
虽然文档说Content-Type是可选的,但它实际上意味着您must设置了正确的content-Type对应于您的 http 请求标头。
在这种情况下,您必须添加content-type: text/plain签名字符串。
https://cloud.google.com/storage/docs/access-control/create-signed-urls-program
| 归档时间: |
|
| 查看次数: |
6226 次 |
| 最近记录: |