可能发送PUT请求到aws s3 presign url?

问题描述 投票:0回答:1

我一直在尝试使用presign URL把一个文件放到我的私有S3 bucket中,但我一直收到这个错误信息。

<Code>SignatureDoesNotMatch</Code> <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

预符号URL是通过以下命令生成的

aws s3 presign s3://<bucket-name>/<file-name> --expires-in 300

但是当我做一个curl的PUT请求时,出现了以下错误

curl -T "<file-name>" "<Generated presign url>"

做了一些研究看到有人说要在请求预署URL时在头中加入'Content_Type',但aws cli没有这个标志可以包含。

是否可以通过aws cli进行put请求?

amazon-web-services amazon-s3 aws-cli pre-signed-url
1个回答
0
投票

AWS CLI还不支持预签名的PUT URL。不过你可以使用Python Boto3轻松生成一个。文档是 此处. 如果你想要一个预签的PUT,你只需要让你的朋友在你的朋友圈里看到你的名字。ClientMethod 参数 put_object.

© www.soinside.com 2019 - 2024. All rights reserved.