问题描述
PutBucketLogging请求中的XML配置格式不正确。
问题原因
您发起了PutBucketLogging请求,但是请求体不是合法的XML结构,或者XML的根节点名称不是BucketLoggingStatus。
问题示例
比如您发起了如下请求:
PUT /?logging HTTP/1.1
Date: GMT Date
Content-Length:ContentLength
Content-Type: application/xml
Authorization: SignatureValue
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
<?xml version="1.0" encoding="UTF-8"?>
<BucketLoggingConf>
<LoggingEnabled>
<TargetBucket>TargetBucket</TargetBucket>
<TargetPrefix>TargetPrefix</TargetPrefix>
</LoggingEnabled>
</BucketLoggingConf>
上述请求请求体XML的根节点是BucketLoggingConf,但是该接口要求根节点名称为BucketLoggingStatus,因此会产生该错误。
解决方案
请确保您发起的请求的请求体是合法的XML结构,且根节点是BucketLoggingStatus:
PUT /?logging HTTP/1.1
Date: GMT Date
Content-Length:ContentLength
Content-Type: application/xml
Authorization: SignatureValue
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
<?xml version="1.0" encoding="UTF-8"?>
<BucketLoggingStatus>
<LoggingEnabled>
<TargetBucket>TargetBucket</TargetBucket>
<TargetPrefix>TargetPrefix</TargetPrefix>
</LoggingEnabled>
</BucketLoggingStatus>
相关文档
文档内容是否对您有帮助?