To list a bucket's website configuration you make a GET request that is
scoped to a bucket and you use the websiteConfig
query string
parameter. The website configuration is returned in an XML document in the
response body. For more information about configuring a bucket as a website,
see Hosting a Static Website.
Query string parameters
Parameter | Description | Required |
---|---|---|
websiteConfig |
You can use this to display the website configuration of an existing bucket. | No |
See signed URL query string parameters for information on the parameters you include when creating and using signed URLs.
Request headers
Request body elements
This request does not include an XML document in the request body.
Request syntax
The following syntax applies to GET Bucket requests that use the
websiteConfig
query string parameter.
GET /?websiteConfig HTTP/1.1 Host: BUCKET_NAME.storage.googleapis.com Date: DATE Content-Length: 0 Authorization: AUTHENTICATION_STRING
Response headers
The request can return a variety of response headers depending on the request headers you use.
Response body elements
The following response body elements are applicable only if you use the
websiteConfig
query string parameter to display the bucket's website
configuration.
Element | Description |
---|---|
WebsiteConfiguration |
Defines the website configuration for the bucket. An empty element (for example
<WebsiteConfiguration/> ) means website configuration
is not set for the bucket. |
MainPageSuffix |
Defines the object to serve when just the domain name is requested, for example, if a site
visitor requests http://www.example.com or http://www.example.com/
(with the trailing slash). |
NotFoundPage |
Defines the object to serve when site visitors request a resource that does not exist. |
Example
Request
GET http://storage.googleapis.com/www.example.com?websiteConfig HTTP/1.1 Host: storage.googleapis.com Content-Length: 0 Authorization: Bearer ya29.AHES6ZRVmB7fkLtd1XTmq6mo0S1wqZZi3-Lh_s-6Uw7p8vtgSwg
Response
<?xml version='1.0' encoding='UTF-8'?> <WebsiteConfiguration> <MainPageSuffix>index.html</MainPageSuffix> <NotFoundPage>404.html</NotFoundPage> </WebsiteConfiguration>