HEAD Object

  • 描述:使用HEAD请求方式获取Object的Metadata。

  • 请求格式:

HEAD /<ObjectName> HTTP/1.1
Host: <Your-Bucket-Name>.ss.bscstorage.com
Date: <date>
Authorization: <authorization string> #请参照《签名算法》
  • 响应(无HTTP Body):
HTTP/1.1 200 OK
Date: Tue, 08 Apr 2014 02:59:47 GMT
Connection: keep-alive
Content-Type: <object-mime-type>
Content-Length: <object-file-bytes>
ETag: "<文件的MD5值>"
Last-Modified: <最后修改时间>
x-amz-request-id: 0000106c-1608-0810-4621-00163e000064
x-amz-s2-requester: <Your UserName>
x-amz-meta-foo1: <value1> #自定义meta:foo1
x-amz-meta-foo2: <value2> #自定义meta:foo2
  • Request Headers(请求头):
Name Description Required
Range Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
• Type: String
• Default: None
• Constraints: None
No
If-Modified-Since Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).
• Type: String
• Default: None
• Constraints: None
No
If-Unmodified-Since Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).
• Type: String
• Default: None
• Constraints: None
No
If-Match Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed).
• Type: String
• Default: None
• Constraints: None
No
If-None-Match Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified).
• Type: String
• Default: None
• Constraints: None
No
  • Response Headers(响应头):
Name Description
Content-Type Object的mime-type
Content-Length Object的Size(bytes)
ETag Object的hash值,一般是md5值
Last-Modified Object的最后修改时间
x-amz-meta-* 用户可自定义文件属性信息,读取时原值返回。
例如:
x-amz-meta-UploadLocation: My Home
X-amz-meta-ReviewedBy: test@test.net
X-amz-meta-FileChecksum: 0x02661779
X-amz-meta-CheckSumAlgorithm: crc32
x-amz-meta-crc32 Object的CRC32值
  • 请求示例:
curl -v -X HEAD -H "Date: Sat, 20 Nov 2286 17:46:39 GMT" -H "Authorization: AWS <access_key>:<ssig>" "http://<Your-Bucket-Name>.ss.bscstorage.com/<Object-Name>"

results matching ""

    No results matching ""