HeadObject
Description
HeadObject only returns the meta information of an object, not the file content.
Request Method
POST
Request Path
/apsara/route/OneRouter/HeadObject
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
If-None-Match | BODY | string | No | 215697CF4417D144C25EB698F5****** | If the incoming ETag value does not match the ETag value of Object, 200 OK and Object Meta are returned; Otherwise, 304 Not Modified is returned. Default value: None |
If-Match | BODY | string | No | 215697CF4417D144C25EB698F5****** | If the incoming ETag matches the ETag of Object, return 200 OK and Object Meta; Otherwise, the 412 precondition failed is returned. Default value: None |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
If-Modified-Since | BODY | string | No | Fri, 24 Feb 2012 07:32:52 GMT | If the time in the incoming parameter is earlier than the actual modification time, return 200 OK and Object Meta; Otherwise, return 304 not modified. Default value: None |
version | BODY | string | No | 2016-01-01 | version of api |
If-Unmodified-Since | BODY | string | No | Fri, 24 Feb 2012 07:32:52 GMT | If the time in the incoming parameter is equal to or later than the actual modification time of the file, 200 OK and Object Meta are returned; Otherwise, the 412 precondition failed is returned. Default value: None |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
x-oss-meta-* | string | x-oss-meta-test | The parameter prefixed with x-oss-meta-is used as the user-defined meta header. When the user sets custom meta prefixed with x-oss-meta-at the time of PutObject, these custom meta are included in the response. |
x-oss-hash-crc64ecma | string | 15429415218160274758 | indicates the 64-bit CRC value of the object. The 64-bit CRC is calculated according to ECMA-182 criteria. for objects created before OSS supports CRC64 verification, this response header may not be returned when calling the HeadObject interface. |
custom header starting with non-x-oss-meta- | string | x-oss-persistent-headers | when the user is PutObject, customize some headers that are not x-oss-meta as prefixes, such as x-oss-persistent-headers:key1:base64_encode(value1),key2:base64_encode(value2)..., the corresponding custom header is added to the response. |
x-oss-object-type | string | Normal | indicates the type of Object. The object uploaded through the PutObject type is Normal. The object type uploaded by AppendObject is Appendable. The object type uploaded by MultipartUpload is Multipart. |
x-oss-next-append-position | string | 100 | this header will be returned for objects of Appendable type, indicating the position that should be provided in the next request. |
x-oss-server-side-encryption | string | KMS | if the object is stored for server-side entropy encoding encryption, this parameter will be returned in the response header, and its value indicates the server-side encryption algorithm of the object. |
Last-Modified | string | Fri, 24 Feb 2012 06:07:48 GMT | the date when Object was last modified, in the format of GMT time specified in HTTP 1.1 protocol. |
x‑oss‑tagging‑count | string | 10 | the number of tags associated with the object. Return only if the user has the right to read the tag. |
x-oss-server-side-encryption-key-id | string | 3dea0cae-5fd6-4bf8-8574-87c557****** | if the user uses server-side encryption when creating the object and the encryption method is KMS, the response will include this header, indicating the KMS CMK ID of the user used for encryption. |
Content-Md5 | string | IVaXz0QX0UTCXraY9Z61mQ== | For Normal type Object, the Md5 value is calculated according to the RFC 1864 standard (excluding Header) to obtain a 128-bit number, and the number is Base64 encoded as the Content-Md5 value of a message. files of Multipart and Appendable types will not return this Header. |
Example
Successful Response example
{
"x-oss-meta-*":"x-oss-meta-test",
"x-oss-hash-crc64ecma":"15429415218160274758",
"custom header starting with non-x-oss-meta-":"x-oss-persistent-headers",
"x-oss-object-type":"Normal",
"x-oss-next-append-position":"100",
"x-oss-server-side-encryption":"KMS",
"Last-Modified":"Fri,
24 Feb 2012 06:07:48 GMT",
"x‑oss‑tagging‑count":"10",
"x-oss-server-side-encryption-key-id":"3dea0cae-5fd6-4bf8-8574-87c557******",
"Content-Md5":"IVaXz0QX0UTCXraY9Z61mQ=="
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}