Skip to main content

HeadObject

Description

The HeadObject operation retrieves metadata from an object without returning the object itself. This operation is useful if you're only interested in an object's metadata.

Permissions

You must have the s3:GetObject permission on the object, or be the bucket owner.

Request Headers

NameDescriptionRequiredType
If-MatchReturn the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. For more information about conditional requests, see RFC 7232.Notext
If-None-MatchReturn the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. For more information about conditional requests, see RFC 7232.Notext
If-Modified-SinceReturn the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. For more information about conditional requests, see RFC 7232.Notext
If-Unmodified-SinceReturn the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. For more information about conditional requests, see RFC 7232.Notext
RangeHeadObject returns only the metadata for an object. If the Range is satisfiable, only the ContentLength is affected in the response. If the Range is not satisfiable, QStorage returns a 416 - Requested Range Not Satisfiable error.Notext
partNumberPart number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object.Notext
versionIdVersion ID used to reference a specific version of the object.Notext
x-amz-checksum-modeTo retrieve the checksum, this parameter must be enabled.Notext
x-amz-expected-bucket-ownerThe account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).Notext
x-amz-request-payerConfirms that the requester knows that they will be charged for the request.Notext
x-amz-server-side-encryption-customer-algorithmSpecifies the algorithm to use when encrypting the object (for example, AES256).Notext
x-amz-server-side-encryption-customer-keySpecifies the customer-provided encryption key for QStorage to use in encrypting data. This value is used to store the object and then it is discarded; QStorage does not store the encryption key.Notext
x-amz-server-side-encryption-customer-key-MD5Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. QStorage uses this header for a message integrity check to ensure that the encryption key was transmitted without error.Notext
response-cache-controlSets the Cache-Control header of the response.Notext
response-content-dispositionSets the Content-Disposition header of the response.Notext
response-content-encodingSets the Content-Encoding header of the response.Notext
response-content-languageSets the Content-Language header of the response.Notext
response-content-typeSets the Content-Type header of the response.Notext
response-expiresSets the Expires header of the response.Notext

Request URI Parameters

None

Request Body

This operation does not have a request body.

Request Syntax

HEAD /ObjectKey?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
Host: BucketName.qstorage.quilibrium.com
If-Match: "7778aef83f66abc1fa1e8477f296d394"
If-None-Match: "7778aef83f66abc1fa1e8477f296d394"
If-Modified-Since: Wed, 01 Mar 2024 12:00:00 GMT
If-Unmodified-Since: Wed, 01 Mar 2024 12:00:00 GMT
x-amz-expected-bucket-owner: OwnerAccountId
Values in italics indicate user input and should be replaced with actual values.

Response Headers

NameDescriptionRequiredType
x-amz-id-2An identifier for the requestNoString
x-amz-request-idA unique identifier for the requestNoString
accept-rangesIndicates that a range of bytes was specifiedNoString
Cache-ControlSpecifies caching behavior along the request/reply chainNoString
Content-DispositionSpecifies presentational information for the objectNoString
Content-EncodingIndicates what content encodings have been applied to the object and thus what decoding mechanisms must be appliedNoString
Content-LanguageThe language the content is inNoString
Content-LengthSize of the body in bytesNoString
Content-RangeThe portion of the object returned in the response for a GET requestNoString
Content-TypeA standard MIME type describing the format of the object dataNoString
ETagAn entity tag that represents a specific version of the objectNoString
ExpiresThe date and time at which the object is no longer cacheableNoString
Last-ModifiedDate and time when the object was last modifiedNoString
x-amz-checksum-crc32The Base64 encoded, 32-bit CRC32 checksum of the objectNoString
x-amz-checksum-crc32cThe Base64 encoded, 32-bit CRC32C checksum of the objectNoString
x-amz-checksum-crc64nvmeThe Base64 encoded, 64-bit CRC64NVME checksum of the objectNoString
x-amz-checksum-sha1The Base64 encoded, 160-bit SHA1 digest of the objectNoString
x-amz-checksum-sha256The Base64 encoded, 256-bit SHA256 digest of the objectNoString
x-amz-checksum-typeThe checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objectsNoString
x-amz-delete-markerSpecifies whether the object retrieved was (true) or was not (false) a Delete MarkerNoString
x-amz-expirationIf the object expiration is configured, the response includes this header with expiry-date and rule-id key-value pairsNoString
x-amz-missing-metaThe number of metadata entries not returned in x-amz-meta headersNoString
x-amz-mp-parts-countThe count of parts this object has for multipart uploadsNoString
x-amz-request-chargedIf present, indicates that the requester was successfully charged for the request

Valid values: requester
NoString
x-amz-restoreIf the object is an archived object, this header provides restoration statusNoString
x-amz-server-side-encryptionThe server-side encryption algorithm used when storing this object in QStorage

Valid values: AES256 | verenc
NoString
x-amz-server-side-encryption-aws-kms-key-idIf present, indicates the ID of the KMS key used for object encryptionNoString
x-amz-server-side-encryption-bucket-key-enabledIndicates whether the object uses an QStorage Bucket Key for server-side encryption with QKMSNoString
x-amz-server-side-encryption-customer-algorithmIf server-side encryption with a customer-provided key was requested, confirms the encryption algorithm usedNoString
x-amz-server-side-encryption-customer-key-MD5If server-side encryption with a customer-provided key was requested, provides verification of the encryption keyNoString
x-amz-version-idVersion ID of the objectNoString
x-amz-website-redirect-locationIf the bucket is configured as a website, redirects requests for this object to another object or URLNoString
x-amz-object-lock-legal-holdSpecifies whether a legal hold is in effect for this object (ON | OFF). Only returned if the requester has the s3:GetObjectLegalHold permissionNoString
x-amz-object-lock-modeThe Object Lock mode (GOVERNANCE | COMPLIANCE) in effect for this object. Only returned if the requester has the s3:GetObjectRetention permission

Valid values: GOVERNANCE | COMPLIANCE
NoString
x-amz-object-lock-retain-until-dateThe date and time when the Object Lock retention period expires.

Constraints: Only returned if the requester has the s3:GetObjectRetention permission
NoString

Response Body

This operation does not return a response body.

Response Errors

Error CodeDescription
NoSuchBucketThe specified bucket does not exist
NoSuchKeyThe specified key does not exist
PreconditionFailedAt least one of the preconditions you specified did not hold
403Forbidden. Authentication failed or you do not have permission to access the object
304Not Modified. The condition specified in If-Modified-Since or If-None-Match headers was not met

Full Examples

Example 1: Get object metadata

HEAD /hello.txt HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
Last-Modified: Wed, 01 Mar 2024 11:00:00 GMT
ETag: "7778aef83f66abc1fa1e8477f296d394"
Content-Length: 11
Content-Type: text/plain
Values in italics indicate variable response values.

Example 2: Get object metadata with conditional request

HEAD /hello.txt HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
If-Modified-Since: Wed, 01 Mar 2024 10:00:00 GMT
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
Last-Modified: Wed, 01 Mar 2024 11:00:00 GMT
ETag: "7778aef83f66abc1fa1e8477f296d394"
Content-Length: 11
Content-Type: text/plain
Values in italics indicate variable response values.

Try It Out

Test HeadObject

Retrieve metadata from an object without returning the object itself.

Coming Soon

This feature is currently under development and will be available soon.