我目前的代码如下所示
s3 = boto3.client('s3')
presigned_url = s3.generate_presigned_url(
'put_object',
Params={'Bucket':bucket_name, 'Key':object_key},
ExpiresIn=3600,
HttpMethod='PUT' )
这是有效的,但我希望包含x-amz-meta-my-custom-meta-data
等自定义标头。我很确定S3支持这个,所以我怎样才能用boto3做到这一点?
从文档中不清楚。 使用Python 3.6
答案 0 :(得分:1)
答案 1 :(得分:0)
将其作为元数据发送
s3 = boto3.client('s3')
presigned_url = s3.generate_presigned_url(
'put_object',
Params={'Bucket':bucket_name, 'Key':object_key, "Metadata": {"mechaGodzilla": "anything is possible"}},
ExpiresIn=3600,
HttpMethod='PUT' )
在您的请求标头中,您必须包含x-amz-meta-mechaGodzilla: "anything is possible"