Skip to main content

Head object

Receives information about the properties of the object in the baquette

Function HeadObject(Val Name, Val Bucket, Val BasicData, Val Version = Undefined, Val Headers = Undefined, Val Directory = False) Export

ParameterCLI optionTypeRequiredDescription
Name--nameStringName of the object in the bucket
Bucket--bucketStringName of the bucket in which the object is stored
BasicData--basicStructure Of KeyAndValueBasic request data. See GetBasicDataStructure
Version--verStringToken for receiving a specific version of an object
Headers--headersMap Of KeyAndValueAdditional request headers, if necessary
Directory--dirBooleanTrue > Path style URL, False > Virtual hosted style URL

Returns: Structure Of KeyAndValue - serialized JSON response from storage


tip

Object metadata is contained in the headers

Method at AWS documentation: GetObjectAttributes


1C:Enterprise/OneScript code example
    URL       = "storage-155.s3hoster.by";
AccessKey = "BRN5RKJE67...";
SecretKey = "NNhv+i9PrytpT8Tu0C1N...";
Region = "BTC";

BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);

Name = "picture.jpg";

Directory = True; // Formation URL in path-style
Bucket = "opi-dirbucket3";
Result = OPI_S3.HeadObject(Name, Bucket, BasicData, , , Directory);
    # JSON data can also be passed as a path to a .json file

oint s3 HeadObject \
--name "pictureU.jpg" \
--bucket "newbucket2" \
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}"
Result
{
"status": 200,
"response": {},
"headers": {
"Accept-Ranges": "bytes",
"Date": "Wed, 15 Oct 2025 10:32:15 GMT",
"ETag": "\"9e0176f87f6565a22f78e0f9b39a4d78\"",
"Server": "MinIO",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Vary": "Origin, Accept-Encoding",
"X-Amz-Id-2": "0757065d17b69556603743b9ea63f04bc7b9f349245bbff6b0ba901258e9c169",
"X-Amz-Request-Id": "186EA38E5013D63D",
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Content-Length": "2114023",
"Content-Type": "application/octet-stream",
"Last-Modified": "Wed, 15 Oct 2025 10:28:41 GMT"
}
}