0019-00000007

Updated at:

Problem description

The XML data in the body of the PutBucketWebSite request that is compatible with Amazon Simple Storage Service (S3) is incorrectly formatted.

Causes

The XML body of the S3-compatible PutBucketWebSite request is invalid. Specifically, the request body uses an invalid XML format, or the root node of the XML request body is not WebsiteConfiguration.

Examples

For example, you initiate the following request:

PUT /?website HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: AWS SignatureValue
x-oss-s3-compat: true

<?xml version="1.0" encoding="UTF-8"?>
<Website xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <IndexDocument>
        <Suffix>index.html</Suffix>
    </IndexDocument>
    <ErrorDocument>
        <Key>errorDocument.html</Key>
    </ErrorDocument>
</Website>

The error is returned for the sample request because the root node of the XML request body is Website instead of WebsiteConfiguration.

Solutions

Make sure that the format and content of the XML request body are valid. The following sample code provides an example of a valid S3-compatible PutBucketWebSite request:

PUT /?website HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: AWS SignatureValue
x-oss-s3-compat: true

<?xml version="1.0" encoding="UTF-8"?>
<WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <IndexDocument>
        <Suffix>index.html</Suffix>
    </IndexDocument>
    <ErrorDocument>
        <Key>errorDocument.html</Key>
    </ErrorDocument>
</WebsiteConfiguration>

References