GET Object Metadata

Users with the READ permission on objects can perform Head operations to retrieve metadata from objects. The metadata of the objects is included in the response.

This operation supports server-side encryption.

Versioning

By default, the metadata of the object of the latest version is obtained. If the object of the latest version has a deletion marker, 404 is returned. You can specify versionId to obtain the metadata of an object of the specific version.

Request Syntax

HEAD /ObjectName HTTP/1.1
Host: bucketname.obs.cn-north-1.myhwclouds.com
Date: date
Authorization: authorization

Request Parameters

Table 1 describes the request parameter.

Table 1 Request parameter

Parameter

Description

Required or Optional

versionId

Indicates the version ID of an object.

Type: string

Optional

Request Headers

This request uses common headers. For details about common headers, see Common Request Headers.

You can add additional headers to this request. For details about the additional headers, see Table 2.

Table 2 Additional request headers

Header

Description

Required or Optional

Origin

Indicates an origin specified by a pre-request. Generally, it is a domain name.

Type: string

Required

Access-Control-Request-Headers

Indicates the HTTP headers of a request. The request can use multiple HTTP headers.

Type: string

Optional

x-amz-server-side-encryption-customer-algorithm

Indicates a decryption algorithm. The header is used in SSE-C mode.

Type: string

Example: x-amz-server-side-encryption-customer-algorithm:AES256

Constraints: This header must be used together with x-amz-server-side-encryption-customer-key and x-amz-server-side-encryption-customer-key-MD5.

Optional. This header is required when SSE-C is used.

x-amz-server-side-encryption-customer-key

Indicates a key used to decrypt objects. The header is used in SSE-C mode.

Type: string

Example: x-amz-server-side-encryption-customer-key:K7QkYpBkM5+hcs27fsNkUnNVaobncnLht/rCB2o/9Cw=

Constraints: This header is a base64-encoded 256-bit key and must be used together with x-amz-server-side-encryption-customer-algorithm and x-amz-server-side-encryption-customer-key-MD5.

Optional. This header is required when SSE-C is used.

x-amz-server-side-encryption-customer-key-MD5

Indicates the MD5 value of a key used to decrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

Type: string

Example: x-amz-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

Constraints: This header is a base64-encoded 128-bit MD5 value and must be used together with x-amz-server-side-encryption-customer-algorithm and x-amz-server-side-encryption-customer-key.

Optional. This header is required when SSE-C is used.

Request Elements

This request involves no elements.

Response Syntax

HTTP/1.1 status_code
Content-Type: type
Date: date
Content-Length: length
Etag: etag
Last-Modified: time

Response Headers

This response uses common headers. For details about common response headers, see Common Response Headers.

This response can also include additional headers. Table 3 describes the header.

Table 3 Additional response headers

Header

Description

x-amz-expiration

This header is included in the response if the object expiration is configured. This header includes expiry-date and rule-id key value pairs to provide object expiration information.

Type: string

x-amz-website-redirect-location

When a bucket is configured as a website, you can set this metadata for the object so that the website endpoint will evaluate the request for the object as a 301 redirection response to another object in the same bucket or an external URL.

Type: string

x-amz-version-id

Indicates the version ID of an object. If an object has no version ID specified, this header is not returned.

Type: string

Default: none

Access-Control-Allow-Origin

Indicates that Origin is included in the response, when CORS is configured for buckets and Origin in the request meets the CORS configuration requirements.

Type: string

Access-Control-Allow-Headers

Indicates that the headers are included in the response, when CORS is configured for buckets and headers in the request meet the CORS configuration requirements.

Type: string

Access-Control-Max-Age

Indicates MaxAgeSeconds in the CORS configuration of a server when CORS is configured for buckets.

Type: integer

Access-Control-Allow-Methods

Indicates that methods in the rule are included in the response, when CORS is configured for buckets and Access-Control-Request-Method in the request meets the CORS configuration requirements.

Type: string

Valid values: GET, PUT, HEAD, POST, and DELETE

Access-Control-Expose-Headers

Indicates ExposeHeader in the CORS configuration of a server when CORS is configured for buckets.

Type: string

x-amz-server-side-encryption

This header is included in a response if SSE-KMS is used.

Type: string

Example: x-amz-server-side-encryption:aws:kms

x-amz-server-side-encryption-aws-kms-key-id

Indicates the master key ID. This header is included in a response if SSE-KMS is used.

Example: x-amz-server-side-encryption-aws-kms-key-id:arn:aws:kms:sichuan:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

x-amz-server-side-encryption-customer-algorithm

Indicates a decryption algorithm. This header is included in a response if SSE-C is used.

Type: string

Example: x-amz-server-side-encryption-customer-algorithm:AES256

x-amz-server-side-encryption-customer-key-MD5

Indicates the MD5 value of a key used to decrypt objects. This header is included in a response if SSE-C is used.

Type: string

Example: x-amz-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

x-amz-storage-class

This header is returned when the storage class of an object is not Standard.

Type: string

Valid values: STANDARD_IA and GLACIER

x-amz-restore

The following provides examples of object restoration status:

  • ongoing-request="true" indicates that the object is being restored.
  • ongoing-request="false" indicates that the object has been restored.
  • In expiry-date="Wed, 07 Nov 2012 00:00:00 GMT", expiry-date indicates the expiry date of the restored object.

Type: string

Response Elements

This response involves no elements.

Error Responses

No special error responses are returned. For details about error responses, see Table 1.

Registration