Skip to main content

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

NameLocationTypeRequiredSample valueDescription
If-None-MatchBODYstringNo215697CF4417D144C25EB698F5******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-MatchBODYstringNo215697CF4417D144C25EB698F5******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
regionIdBODYstringYesNo sample value for this parameter.region id
If-Modified-SinceBODYstringNoFri, 24 Feb 2012 07:32:52 GMTIf 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
versionBODYstringNo2016-01-01version of api
If-Unmodified-SinceBODYstringNoFri, 24 Feb 2012 07:32:52 GMTIf 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

NameTypeSample valueDescription
x-oss-meta-*stringx-oss-meta-testThe 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-crc64ecmastring15429415218160274758indicates 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-stringx-oss-persistent-headerswhen 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-typestringNormalindicates 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-positionstring100this header will be returned for objects of Appendable type, indicating the position that should be provided in the next request.
x-oss-server-side-encryptionstringKMSif 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-ModifiedstringFri, 24 Feb 2012 06:07:48 GMTthe date when Object was last modified, in the format of GMT time specified in HTTP 1.1 protocol.
x‑oss‑tagging‑countstring10the 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-idstring3dea0cae-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-Md5stringIVaXz0QX0UTCXraY9Z61mQ==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
}

}