Deleting multiple objects
A POST given a path to an bucket and proper parameters will delete a
specified set of objects.
An integrity check is required by using either content-md5,
a x-amz-checksum- header, or the x-amz-content-sha256 header.
This operation does not make use of operation specific query parameters (besides versioning), or payload elements.
Optional headers
| Header | Type | Description |
|---|---|---|
x-amz-bypass-governance-retentionType: |
string (true/false) | If the object is protected by Object Lock, deletion is only allowed when the retention
period has expired, or if the object is in GOVERNANCE mode and the delete request includes the
header. The requester must also have the required bypass permission to
successfully delete the object before retention expiry. |
Syntax
POST https://{endpoint}/{bucket-name}/{object-name}?delete= # path style
POST https://{bucket-name}.{endpoint}/{object-name}?delete= # virtual host style
Sample request
POST /example?delete= HTTP/1.1
Authorization: {authorization-string}
Host: 67.228.254.193
x-amz-date: 20161205T231624Z
x-amz-content-sha256: 3ade096cd9471017539ede10c4d8aa05a1ecd015a16f4f090e9fcee92a816cf4
Content-MD5: zhi+TmIAhD2U3GfoYayyTQ==
Content-Type: text/plain; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<Delete>
<Object>
<Key>surplus-bee</Key>
</Object>
<Object>
<Key>unnecessary-bee</Key>
</Object>
</Delete>
Sample response
HTTP/1.1 200 OK
Date: Wed, 30 Nov 2016 18:54:53 GMT
X-Clv-Request-Id: a6232735-c3b7-4c13-a7b2-cd40c4728d51
Accept-Ranges: bytes
Server: Cleversafe/3.9.0.137
X-Clv-S3-Version: 2.5
x-amz-request-id: a6232735-c3b7-4c13-a7b2-cd40c4728d51
Content-Type: application/xml
Content-Length: 207
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Deleted>
<Key>surplus-bee</Key>
</Deleted>
<Deleted>
<Key>unnecessary-bee</Key>
</Deleted>
</DeleteResult>