DELETE Bucket

Last updated: 2023-09-19 15:53:44

Feature Overview

This API is used to delete a specified bucket. To call this API, you need to have permission to write to the bucket.
Note
Before deleting a bucket, ensure that all data and unfinished uploaded parts within the bucket have been cleared; otherwise, the bucket cannot be deleted.


Requests

Sample Request

DELETE / HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: 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

This API only uses Common Request Headers.

Request Body

The request body of this request is empty.

Response

Response Header

This API only returns Common Response Headers.

Response Body

The response body of this API is empty.

Error Codes

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

Examples

Requests

DELETE / HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Tue, 28 May 2019 03:19:13 GMT
Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO**&q-sign-time=1559013553;1559020753&q-key-time=1559013553;1559020753&q-header-list=date;host&q-url-param-list=&q-signature=478b1db6182db32c8ed459dfa723a9f500b2**
Connection: close

Response

HTTP/1.1 204 No Content
Content-Length: 0
Connection: close
Date: Tue, 28 May 2019 03:19:14 GMT
Server: tencent-cos
x-cos-request-id: NWNlY2E4YjFfNjljMDBiMDlfMmNiZTlfZGE0****