HeadObject

The HEAD action retrieves metadata from an object without returning the object itself.

This action is useful if you are only interested in an object’s metadata.

A HEAD request has the same options as a GET action on an object. The response is identical to the GET response, except there is no response body.

You must have Read ACL to be able to call this action.

The following operations are related to HeadObject:

Request Syntax

1HEAD /<KEY>?partNumber=PartNumber&response-cache-control=ResponseCacheControl&response-content-disposition=ResponseContentDisposition&response-content-encoding=ResponseContentEncoding&response-content-language=ResponseContentLanguage&response-content-type=ResponseContentType&response-expires=ResponseExpires&versionId=VersionId HTTP/1.1
2Host: <BUCKET>.s3.tebi.io
3Range: Range
4If-Modified-Since: IfModifiedSince
5If-None-Match: IfNoneMatch
6x-amz-server-side-encryption-customer-algorithm: SSECustomerAlgorithm
7x-amz-server-side-encryption-customer-key: SSECustomerKey
8x-amz-server-side-encryption-customer-key-MD5: SSECustomerKeyMD5

The request uses the following URI parameters:

  • <BUCKET>: Bucket name containing the object. Required.

  • <KEY>: Key of the object to get. Required.

  • response-cache-control: Sets the Cache-Control header of the response.

  • response-content-disposition: Sets the Content-Disposition header of the response.

  • response-content-encoding: Sets the Content-Encoding header of the response.

  • response-content-language: Sets the Content-Language header of the response.

  • response-content-type: Sets the Content-Type header of the response.

  • response-expires: Sets the Expires header of the response.

  • Range: Downloads the specified range(s) (in bytes) of an object.

  • If-Modified-Since: Returns the object only if it has been modified since the specified time, otherwise returns a 304 (not modified).

  • If-None-Match: Returns the object only if its entity tag (ETag) is different from the one specified, otherwise returns a 304 (not modified).

  • x-amz-server-side-encryption-customer-algorithm: Specifies the algorithm to use to when decrypting the object (for example, AES256).

  • x-amz-server-side-encryption-customer-key: Specifies the customer-provided encryption key for Tebi, which is used to encrypt the data. This value is used to decrypt the object when recovering it and must match the one used when storing the data. The key must be appropriate for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm header.

  • x-amz-server-side-encryption-customer-key-MD5: Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Tebi uses this header for a message integrity check to ensure that the encryption key was transmitted without error.

The request does not have a request body.

Response Syntax

 1HTTP/1.1 200
 2Accept-Ranges: AcceptRanges
 3Last-Modified: LastModified
 4Content-Length: ContentLength
 5Cache-Control: CacheControl
 6Content-Disposition: ContentDisposition
 7Content-Encoding: ContentEncoding
 8Content-Language: ContentLanguage
 9Content-Range: ContentRange
10Content-Type: ContentType
11Expires: Expires
12ETag: ETag
13x-amz-expiration: Expiration
14x-amz-website-redirect-location: WebsiteRedirectLocation
15x-amz-server-side-encryption: ServerSideEncryption
16x-amz-server-side-encryption-customer-algorithm: SSECustomerAlgorithm
17x-amz-server-side-encryption-customer-key-MD5: SSECustomerKeyMD5
18x-amz-storage-class: StorageClass

If the action is successful, the service sends back an HTTP 200 response.

The response returns the following HTTP headers:

  • Accept-Ranges: Indicates that a range of bytes was specified.

  • Last-Modified: Creation date of the object.

  • Content-Length: Size of the body in bytes.

  • Cache-Control: Specifies caching behavior along the request/reply chain.

  • Content-Disposition: Specifies presentational information for the object.

  • Content-Encoding: Specifies which content encodings have been applied to the object and thus which decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

  • Content-Language: Language the content is in.

  • Content-Range: Portion of the object returned in the response.

  • Content-Type: Standard MIME type describing the format of the object data.

  • Expires: Date and time at which the object is no longer cacheable.

  • ETag: Opaque identifier assigned by a web server to a specific version of a resource found at a URL.

  • x-amz-expiration: If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key-value pairs providing object expiration information. The value of the rule-id is URL encoded.

  • x-amz-website-redirect-location: If the bucket is configured as a website, this redirects requests for the object to another object in the same bucket or to an external URL. Tebi stores the value of this header in the object metadata.

  • x-amz-server-side-encryption: Server-side encryption algorithm used when storing this object in Tebi (AES256).

  • x-amz-server-side-encryption-customer-algorithm: If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

  • x-amz-server-side-encryption-customer-key-MD5: If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round-trip message integrity verification of the customer-provided encryption key.

  • x-amz-storage-class: User-defined storage class. Tebi returns this header for all objects except for STANDARD storage class objects. For more information see Storage Classes Overview.

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

See Also

Refer here for more information.