接口:DeleteObject

简要概述

删除文件 官方文档

接口解析

请求语法

DELETE /{object_key}?versionId= HTTP/1.1

Host: {bucket}.{endpoint}

x-amz-mfa: MFA
x-amz-request-payer: RequestPayer
x-amz-bypass-governance-retention: BypassGovernanceRetention
x-amz-expected-bucket-owner: ExpectedBucketOwner

URL 参数

名称 类型 是否必须 示例 说明

请求结构

无。

响应语法

HTTP/1.1 204

x-amz-delete-marker: DeleteMarker
x-amz-version-id: VersionId
x-amz-request-charged: RequestCharged

响应参数

名称 类型 示例 说明

请求示例

通过 rclone 进行测试

测试指令

./rclone \
	--dump bodies \
	--s3-force-path-style=false \
	deletefile \
	minio:uptime/copy/from/hello-a.txt

请求响应

2023/06/21 14:00:33 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/06/21 14:00:33 DEBUG : HTTP REQUEST (req 0x1400073a300)
2023/06/21 14:00:33 DEBUG : DELETE /copy/from/hello-a.txt HTTP/1.1
Host: uptime.minio.dev.173ops.com
User-Agent: rclone/v1.62.2
Authorization: XXXX
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20230621T060033Z
Accept-Encoding: gzip

2023/06/21 14:00:33 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/06/21 14:00:33 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/06/21 14:00:33 DEBUG : HTTP RESPONSE (req 0x1400073a300)
2023/06/21 14:00:33 DEBUG : HTTP/1.1 204 No Content
Accept-Ranges: bytes
Connection: keep-alive
Content-Security-Policy: block-all-mixed-content
Date: Wed, 21 Jun 2023 06:00:33 GMT
Server: nginx/1.16.1
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
Vary: Accept-Encoding
X-Amz-Id-2: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8
X-Amz-Request-Id: 176A972DD823EE60
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block

2023/06/21 14:00:33 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<