最近更新时间:2021-12-24
使用DeleteObjects接口从Bucket中删除多个Object。
POST /?delete HTTP/1.1 Host: examplebucket.region.unicloudsrv.com Authorization: authorization string Content-Length: Size Content-MD5: MD5
<?xml version="1.0" encoding="UTF-8"?> <Delete> <Quiet>true</Quiet> <Object> <Key>Key</Key> <VersionId>VersionId</VersionId> </Object> <Object> <Key>Key</Key> </Object> ... </Delete> |
参数 | 描述 |
Content-MD5 | base64编码的128位MD5 |
Content-Length | 基于RFC 2616的消息体长度 |
x-amz-mfa | 认证设备序列号,空间并且该值显示在认证设备上 |
Delete | 请求容器 |
Quiet | 元素为请求启用静态模式,当添加该元素是必须设置为true |
Object | 描述删除一个Object的请求。 |
Key | 待删除Object的key名称 |
VersionId | 待删除Object的版本ID |
参数 | 描述 |
DeleteResult | 响应容器 |
Deleted | 成功删除的元素容器 |
Key | 待删除Object的key名称 |
VersionId | 待删除的指定版本Object的VersionId |
DeleteMarker | 该值设置为true表示删除请求访问了一个删除标记 |
DeleteMarkerVersionId | 被删除或创建请求访问的删除标记的版本号 |
Error | 删除产生的错误容器 |
Key | 待删除Object的key |
VersionId | 待删除的指定版本Object的VersionId |
Code | 删除失败的状态码 |
Message | 错误描述 |
POST /?delete HTTP/1.1 Host: test.oss-cn-north-1.unicloudsrv.com Accept: */* x-amz-date: Wed, 30 Nov 2011 03:39:05 GMT Content-MD5: p5/WA/oEr30qrEEl21PAqw== Authorization: AWS AKIAIOSFODNN7EXAMPLE:W0qPYCLe6JwkZAD1ei6hp9XZIee= Content-Length: 125 Connection: Keep-Alive
<Delete> <Object> <Key>sample1.txt</Key> </Object> <Object> <Key>sample2.txt</Key> </Object> </Delete> |
HTTP/1.1 200 OK x-amz-id-2: 5h4FxSNCUS7wP5z92eGCWDshNpMnRuXvETa4HH3LvvH6VAIr0jU7tH9kM7X+njXx x-amz-request-id: A437B3B641629AEE Date: Fri, 02 Dec 2011 01:53:42 GMT Content-Type: application/xml Server: los Content-Length: 251
<?xml version="1.0" encoding="UTF-8"?> <DeleteResult xmlns="http://oss-cn-north-1.unicloudsrv.com/doc/2006-03-01/"> <Deleted> <Key>sample1.txt</Key> </Deleted> <Error> <Key>sample2.txt</Key> <Code>AccessDenied</Code> <Message>Access Denied</Message> </Error> </DeleteResult> |