gpt4 book ai didi

.net - Amazon S3 元数据键被前缀,如何避免这种情况?

转载 作者:行者123 更新时间:2023-12-04 06:57:46 27 4
gpt4 key购买 nike

我有向 s3 存储桶写入内容的代码。

 PutObjectRequest titledRequest = new PutObjectRequest();
titledRequest.WithMetaData("Eip1", "Volume-1")
.WithMetaData("Eip2", "Volume-2")
.WithContentBody("this is an Elastic IP Address Details for a Volumes")
.WithBucketName(bucketName)
.WithKey(keyName);

并使用阅读它
   AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKeyID,  secretAccessKeyID);

GetObjectRequest request = new GetObjectRequest().WithBucketName(bucketName).WithKey(keyName);

string title = response.Metadata.Get("Eip1");

但得到 null 作为返回,调试时我看到 response.Metadata.Keys 有

x-amz-meta-eip1
& x-amz-meta-eip2

这个键是如何被重命名的,如何避免这种情况?

为什么它们的前缀是 x-amz-meta-

最佳答案

它们在设计上以这种方式作为前缀“以将它们区分为自定义 HTTP header ”

http://docs.amazonwebservices.com/AmazonS3/latest/index.html?UsingMetadata.html

关于.net - Amazon S3 元数据键被前缀,如何避免这种情况?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2342208/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com