Last update:2022-03-01 18:01:06
To perform multiple file deletion, IAM wos:DeleteObject permission is required
POST /?delete HTTP/1.1
Host: Bucket.Endpoint
x-amz-mfa: MFA
x-amz-request-payer: RequestPayer
x-amz-bypass-governance-retention: BypassGovernanceRetention
<?xml version="1.0" encoding="UTF-8"?>
<Delete xmlns=" http://wcs.chinanetcenter.com/document ">
<Object>
<Key>string</Key>
</Object>
...
<Quiet>boolean</Quiet>
</Delete>
no
Only use public request headers .
The request body is the following xml information
Element name | Element description | Is it required |
Delete | Define deletion information. Type: XML Child nodes: Object, Quiet Parent node: empty | Yes |
Object | Define a certain deletion object information. Type: XML Parent node: Delete Child node: Key | Yes |
Key | Define the name of the deleted object. Type: String Parent node: Delete Child node: Key | Yes |
Quiet | Define whether to use quiet mode, the value is true, false Type: Boolean Parent node: Delete Child node: none | no |
HTTP/1.1 200 OK
x-amz-request-id: request id
Connection: close
Content-Type: application/xml
Content-Length: 206
Date: date
Server: WS-web-server
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DeleteResult xmlns="http://wcs.chinanetcenter.com/document">
<Deleted>
<Key>string</Key>
</Deleted>
<Deleted>
<Key>string</Key>
</Deleted>
<Error>
<Code>string</Code>
<Key>string</Key>
<Message>string</Message>
</Error>
<Error>
<Code>string</Code>
<Key>string</Key>
<Message>string</Message>
</Error>
</DeleteResult>
Only use public response headers .
Element name | Element description |
Deleted | Object information has been deleted. Type: XML Child node: Key Parent node: empty |
Key | The object name has been deleted. Type: String Parent node: Deleted Child node: empty |
Error | Delete failed object information Type: XML Parent node: empty Child nodes: Code, Key, Message |
Code | Delete failed code. Type: String Parent node: Error Child node: empty |
Key | The name of the object that failed to delete. Type: String Parent node: Error Child node: empty |
Message | Delete failed message. Type: String Parent node: Error Child node: empty |
POST /?delete HTTP/1.1
Host: bucket.s3-cn-east-1.wcsapi.com
Accept-Encoding: identity
User-Agent: aws-cli/1.17.17 Python/3.8.0 Windows/10 botocore/1.14.17
Content-MD5: mno5HqDRSTJY/yusgaPLeQ==
X-Amz-Date: 20200331T055821Z
X-Amz-Content-SHA256: f33ffe2a28873df81b0fac7f39344fbc12127e7b3641b3c9e83346147a694c16
Authorization: AWS4-HMAC-SHA256 Credential=L18Gy5jN4fChwat419iDc0i8divP8nVwQahS/20200331/region98/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=3dd0861c930fbdecedfdd764c4f4d322c321ab2738ef7d9dd5a3dec908a7391f
Content-Length: 156
<Delete xmlns="http://wcs.chinanetcenter.com/document">
<Object>
<Key>10Mfile</Key>
</Object>
<Object>
<Key>100Mfile</Key>
</Object>
<Quiet>false</Quiet>
</Delete>
HTTP/1.1 200 OK
x-amz-request-id: 209822119924133820200331135846tM1lmMCvsampled
Connection: close
Content-Type: application/xml
Content-Length: 206
Date: Tue, 31 Mar 2020 05:58:51 GMT
Server: WS-web-server
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DeleteResult xmlns="http://wcs.chinanetcenter.com/document">
<Deleted>
<Key>100Mfile</Key>
</Deleted>
<Deleted>
<Key>10Mfile</Key>
</Deleted>
</DeleteResult>