Feature Overview
This API (
HEAD Bucket) is used to verify whether a bucket exists and whether you have permission to access it.If the bucket exists and you have permission to read it, HTTP status code 200 will be returned.
If you do not have permission to read the bucket, HTTP status code 403 will be returned.
If the bucket does not exist, HTTP status code 404 will be returned.
Requests
Sample Request
HEAD / HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth String
Note
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com, where <BucketName-APPID> is the bucket name with the APPID suffix, such as examplebucket-1250000000. You can refer to the Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Convention documentation. <Region> represents the available regions for COS, which can be found in the Regions and Access Domain Names documentation.
Authorization: Auth String (For more information, see Request Signature.)
Request Parameters
This API has no request parameter.
Request Header
Request Body
This API does not have a request body.
Response
Response Header
In addition to common response headers, this API also returns the following response headers. For more information on common response headers, see Common Response Headers.
Name | Description | Local Disk Types |
x-cos-bucket-az-type | AZ type of the bucket. This header is returned only for MAZ buckets. Fixed to MAZ. | Enum |
x-cos-bucket-region | The region where the bucket is located. For a list of valid values, refer to the Regions and Access Domain Names document, such as ap-beijing, ap-hongkong, eu-frankfurt, etc. | Enum |
Response Body
The response body of this API is empty.
Error Codes
Examples
Sample 1: OAZ bucket
Requests
HEAD / HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Tue, 28 May 2019 03:16:12 GMTAuthorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO**&q-sign-time=1559013372;1559020572&q-key-time=1559013372;1559020572&q-header-list=date;host&q-url-param-list=&q-signature=9085930afacf1e8a0ade2697b69353b27901**Connection: close
Response
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 0Connection: closeDate: Tue, 28 May 2019 03:16:12 GMTServer: tencent-cosx-cos-bucket-region: ap-beijingx-cos-request-id: NWNlY2E3ZmNfZjhjMDBiMDlfMTBjOWRfZDcz****
Sample 2: MAZ bucket
Requests
HEAD / HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Thu, 04 Jun 2020 06:43:03 GMTAuthorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO**&q-sign-time=1591252983;1591260183&q-key-time=1591252983;1591260183&q-header-list=date;host&q-url-param-list=&q-signature=aa996608fe79d122ed9667d9db3caa262ed6**Connection: close
Response
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 0Connection: closeDate: Thu, 04 Jun 2020 06:43:03 GMTServer: tencent-cosx-cos-bucket-az-type: MAZx-cos-bucket-region: ap-beijingx-cos-request-id: NWVkODk3ZjdfZjI4NWQ2NF9hODhkXzRhNmQ0****