接口:HeadObject
2 分钟阅读
简要概述
查看文件 官方文档
接口解析
请求语法
HEAD /{object_key}?partNumber=&versionId= HTTP/1.1
Host: {bucket}.{endpoint}
If-Match: IfMatch
If-Modified-Since: IfModifiedSince
If-None-Match: IfNoneMatch
If-Unmodified-Since: IfUnmodifiedSince
Range: Range
x-amz-server-side-encryption-customer-algorithm: SSECustomerAlgorithm
x-amz-server-side-encryption-customer-key: SSECustomerKey
x-amz-server-side-encryption-customer-key-MD5: SSECustomerKeyMD5
x-amz-request-payer: RequestPayer
x-amz-expected-bucket-owner: ExpectedBucketOwner
x-amz-checksum-mode: ChecksumMode
URL 参数
名称 | 类型 | 是否必须 | 示例 | 说明 |
---|
请求结构
无。
响应语法
HTTP/1.1 200
x-amz-delete-marker: DeleteMarker
accept-ranges: AcceptRanges
x-amz-expiration: Expiration
x-amz-restore: Restore
x-amz-archive-status: ArchiveStatus
Last-Modified: LastModified
Content-Length: ContentLength
x-amz-checksum-crc32: ChecksumCRC32
x-amz-checksum-crc32c: ChecksumCRC32C
x-amz-checksum-sha1: ChecksumSHA1
x-amz-checksum-sha256: ChecksumSHA256
ETag: ETag
x-amz-missing-meta: MissingMeta
x-amz-version-id: VersionId
Cache-Control: CacheControl
Content-Disposition: ContentDisposition
Content-Encoding: ContentEncoding
Content-Language: ContentLanguage
Content-Type: ContentType
Expires: Expires
x-amz-website-redirect-location: WebsiteRedirectLocation
x-amz-server-side-encryption: ServerSideEncryption
x-amz-server-side-encryption-customer-algorithm: SSECustomerAlgorithm
x-amz-server-side-encryption-customer-key-MD5: SSECustomerKeyMD5
x-amz-server-side-encryption-aws-kms-key-id: SSEKMSKeyId
x-amz-server-side-encryption-bucket-key-enabled: BucketKeyEnabled
x-amz-storage-class: StorageClass
x-amz-request-charged: RequestCharged
x-amz-replication-status: ReplicationStatus
x-amz-mp-parts-count: PartsCount
x-amz-object-lock-mode: ObjectLockMode
x-amz-object-lock-retain-until-date: ObjectLockRetainUntilDate
x-amz-object-lock-legal-hold: ObjectLockLegalHoldStatus
响应参数
名称 | 类型 | 示例 | 说明 |
---|
请求示例
通过 rclone 进行测试
测试指令
./rclone \
--dump bodies \
--s3-force-path-style=false \
lsl \
minio:uptime/test1/hello.txt
请求响应
2023/06/21 14:39:24 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/06/21 14:39:24 DEBUG : HTTP REQUEST (req 0x1400022d400)
2023/06/21 14:39:24 DEBUG : HEAD /test1/hello.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: 20230621T063924Z
2023/06/21 14:39:24 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/06/21 14:39:24 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/06/21 14:39:24 DEBUG : HTTP RESPONSE (req 0x1400022d400)
2023/06/21 14:39:24 DEBUG : HTTP/1.1 200 OK
Content-Length: 7
Accept-Ranges: bytes
Connection: keep-alive
Content-Security-Policy: block-all-mixed-content
Content-Type: text/plain; charset=utf-8
Date: Wed, 21 Jun 2023 06:39:24 GMT
Etag: "5e9820c5fde06ad204bc506739059ea5"
Last-Modified: Wed, 21 Jun 2023 05:36:53 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-Meta-Mtime: 1687253796
X-Amz-Request-Id: 176A994C989C0108
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
2023/06/21 14:39:24 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
最后修改 2023.07.06: refactor: update some (5fe4b38)