GET Bucket website

Last updated: 2020-07-02 17:13:04

    Feature

    This API is used to obtain the configuration of the static website associated with the bucket.

    Request

    Request samples

    GET /?website HTTP/1.1
    Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
    Date: GMT Date
    Authorization: Auth String

    Authorization: Auth String (see Request Signature for more information)

    Request parameters

    This API does not use any request parameter.

    Request headers

    This API only uses common request headers. For more information on common request headers, see Common Request Headers.

    Request body

    This API does not have a request body.

    Response

    Response headers

    This API only returns a common response header. For more information, see Common Response Headers.

    Response body

    A successful query will return application/xml data which includes all information about the static website configuration on the bucket.

    <WebsiteConfiguration>
        <IndexDocument>
            <Suffix>string</Suffix>
        </IndexDocument>
        <RedirectAllRequestsTo>
            <Protocol>string</Protocol>
        </RedirectAllRequestsTo>
        <ErrorDocument>
            <Key>string</Key>
        </ErrorDocument>
        <RoutingRules>
            <RoutingRule>
                <Condition>
                    <HttpErrorCodeReturnedEquals>integer</HttpErrorCodeReturnedEquals>
                </Condition>
                <Redirect>
                    <Protocol>string</Protocol>
                    <ReplaceKeyWith>string</ReplaceKeyWith>
                </Redirect>
            </RoutingRule>
            <RoutingRule>
                <Condition>
                    <KeyPrefixEquals>string</KeyPrefixEquals>
                </Condition>
                <Redirect>
                    <Protocol>string</Protocol>
                    <ReplaceKeyPrefixWith>string</ReplaceKeyPrefixWith>
                </Redirect>
            </RoutingRule>
        </RoutingRules>
    </WebsiteConfiguration>

    The detailed nodes are described as follows:

    Node Name (Keyword) Parent Node Description Type
    WebsiteConfiguration None Saves all information in the response to GET Bucket website Container

    Content of the Container node WebsiteConfiguration:

    Node Name (Keyword) Parent Node Description Type
    IndexDocument WebsiteConfiguration Index document Container
    RedirectAllRequestsTo WebsiteConfiguration Redirects all requests Container
    ErrorDocument WebsiteConfiguration Error document Container
    RoutingRules WebsiteConfiguration Sets redirect rules Container

    Content of the Container node IndexDocument:

    Node Name (Keyword) Parent Node Description Type
    Suffix WebsiteConfiguration.IndexDocument Specifies the object key suffix for index documents. For example, if it is specified as index.html, the request automatically returns index.html when you access the root directory of the bucket, or article/index.html when you access the directory article/. string

    Content of the Container node RedirectAllRequestsTo:

    Node Name (Keyword) Parent Node Description Type
    Protocol WebsiteConfiguration.RedirectAllRequestsTo Specifies the destination protocol for all redirect requests string

    Content of the Container node ErrorDocument:

    Node Name (Keyword) Parent Node Description Type
    Key WebsiteConfiguration.ErrorDocument Specifies the object key of the general error document string

    Content of the Container node RoutingRules:

    Node Name (Keyword) Parent Node Description Type
    RoutingRule WebsiteConfiguration.RoutingRules Sets a single redirect rule Container

    Content of the Container node RoutingRules.RoutingRule: