tencent cloud

Feedback

HEAD Bucket

Last updated: 2021-10-22 12:50:02

    Overview

    This API 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.
    API Explorer is recommended.
    Debug
    API Explorer makes it easy to make online API calls, verify signatures, generate SDK code, search for APIs, etc. You can also use it to query the content of each request as well as its response.

    Request

    Sample request

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

    Request parameters

    This API has no request parameter.

    Request headers

    This API only uses Common Request Headers.

    Request body

    This API does not have a request body.

    Response

    Response headers

    In addition to common response headers, this API also returns the following response headers. For more information about common response headers, please see Common Response Headers.

    Header Description Type
    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 Bucket region, such as ap-beijing, ap-hongkong, and eu-frankfurt. For the enumerated values, please see Regions and Access Endpoints. Enum

    Response body

    The response body of this API is empty.

    Error codes

    This API returns common error responses and error codes. For more information, please see Error Codes.

    Examples

    Example 1: OAZ bucket

    Request

    HEAD / HTTP/1.1
    Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
    Date: Tue, 28 May 2019 03:16:12 GMT
    Authorization: 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 OK
    Content-Type: application/xml
    Content-Length: 0
    Connection: close
    Date: Tue, 28 May 2019 03:16:12 GMT
    Server: tencent-cos
    x-cos-bucket-region: ap-beijing
    x-cos-request-id: NWNlY2E3ZmNfZjhjMDBiMDlfMTBjOWRfZDcz****
    

    Example 2: MAZ bucket

    Request

    HEAD / HTTP/1.1
    Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
    Date: Thu, 04 Jun 2020 06:43:03 GMT
    Authorization: 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 OK
    Content-Type: application/xml
    Content-Length: 0
    Connection: close
    Date: Thu, 04 Jun 2020 06:43:03 GMT
    Server: tencent-cos
    x-cos-bucket-az-type: MAZ
    x-cos-bucket-region: ap-beijing
    x-cos-request-id: NWVkODk3ZjdfZjI4NWQ2NF9hODhkXzRhNmQ0****
    

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support