tencent cloud


Setting Hotlink Protection

Last updated: 2020-08-04 09:54:19


    This API is used to add hotlink protection (set blocklist/allowlist) for a bucket.


    Request example

    PUT /?hotlink HTTP/1.1
    Host: <BucketName-APPID>.pic.<Region>.myqcloud.com
    Date: GMT Date
    Authorization: Auth String

    Authorization: Auth String. For more information, see Request Signature.

    Request headers

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

    Request body

    The node content of this request body is as follows:


    The content is described in details below:

    | Node Name | Parent Node | Description | Type | Required |

    | :--- | :------ | :------------------------------------------------------- | :-------- | :--- |

    | Url | Hotlink | Indicates the domain name address. | Container | Yes |

    | Type | Hotlink | Indicates the hotlink protection type. The value white indicates allowlist, the value black indicates blocklist, and the value off indicates the hotlink protection is disabled. | String | Yes |


    Response headers

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

    Response body

    The response body of this response is empty.

    Use Cases


    PUT /?hotlink HTTP/1.1
    Host: examplebucket-1250000000.pic.ap-chengdu.myqcloud.com
    Date: Wed, 18 Mar 2000 06:57:54 GMT
    Authorization: XXXXXXXXXXXX


    HTTP/1.1 200 OK
    Content-Length: 0
    Connection: keep-alive
    Date: Fri, 25 Feb 2017 04:10:22 GMT
    Server: tencent-cos
    x-cos-request-id: NTg3ZjFjMmJfOWIxZjRlXzZmNDhf****
    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