c# - C# AWSSDK 调用 PutObjectAsync 返回 400 Bad Request InvalidArgument Unsupported Authoriaztion Type
问题描述
var config = new AmazonS3Config
{
ServiceURL = url,
ForcePathStyle = true,
};
var client = new AmazonS3Client(accesskeyId, accesskey, config);
var request = new PutObjectRequest
{
BucketName = bucketName,
Key = $"ping_{Guid.NewGuid().ToString("N")}.txt",
ContentType = "text/plain",
}
};
var response = await client.PutObjectAsync(request);
我收到错误:
StatusCode:400
ErrorCode:InvalidArgument
消息:不支持授权类型
Aws-sdk 版本:3.3.113.2
如果我使用 awssdk 3.1,没关系。有人知道吗?
解决方案
推荐阅读
- web-services - 只有“hello”函数在我的 WSDL 中工作
- mfc - 将 CStringArray 数据复制到无符号字符数组
- java - wildfly swarm jdk10 支持
- php - 即使 sql 正确,第二个准备语句也不起作用
- ios - NSNumber 在 Objective-C 中存储 NSDictionary 的对象
- php - 密码验证总是返回错误值?
- c - n 太大的 strncmp 会给出奇怪的输出
- pandas - 熊猫数据框选择列最后一个值并替换为空白
- python - 访问调用函数的变量
- android - 将 Parcelable 对象传递给片段类型不匹配