Set Static Website Hosting
Last Updated:2021-09-13
Interface Description
This interface is used to set the static website hosting.
The user must have the FULL_CONTROL permission for the bucket. It is not recommended to set the archive file. The archive file is not unreadable when it is not retrieved, and StaticWebsite is not effective at this time.
Request URI
PUT /v1/{bucketName}/?website
Parameter Name | Parameter Type | Required | Description | Example Value | Parameter Position |
---|---|---|---|---|---|
bucketName | String | Yes | Bucket name | "bucketName_example" | Path |
Request Body Parameters
Instructions for Data Structure of Request Body Field
Parameter name | Parameter Type | Required | Description | Example Value |
---|---|---|---|---|
index | String | No | Index file name | index.html |
notFound | String | No | 404 file name | 404.html |
Response Body Parameters
Instructions for Data Structure of Response Body Field
Request Example
PUT /v1/bucketName_example/?website
Common Request Header
PUT /?website HTTP/1.1
Host: <BcuketName>.bj.bcebos.com
Date: Tue, 17 May 2016 08:36:52 GMT
Authorization: AuthorizationString
Content-Length: 65
{
"index": "index.html",
"notFound": "404.html"
}
Response Example
HTTP/1.1 200 OK
<Common response header>
HTTP/1.1 200 OK
x-bce-request-id: 1a5fd81e-626b-45b3-a885-15fff9cd106c
Date: Tue, 17 May 2016 08:36:52 GMT
Content-Length: 0
Server: BceBos
Error Code
Refer to the universal error code.