Skip to content

HeadObject

Source: src/AWS/S3/HeadObject.ts

Runtime binding for s3:HeadObject.

Bind this operation to a bucket to get a callable that reads an object’s metadata (size, content type, ETag) without downloading the body. Provide the implementation with Effect.provide(AWS.S3.HeadObjectHttp).

// init — bind the operation to the bucket
const headObject = yield* AWS.S3.HeadObject(bucket);
// runtime — inspect without transferring the body
const head = yield* headObject({ Key: "uploads/report.pdf" });
const size = head.ContentLength;
const contentType = head.ContentType;