tencent cloud

Cloud Object Storage

HEAD Object

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2026-02-02 17:20:16

Introduction

This document provides an overview of the APIs related to querying object metadata and includes SDK sample code.
API
Operation Name
Operation Description
Querying Metadata of Objects
Query the metadata of an object.

Querying Metadata of Objects

Feature Overview

Query the metadata of an Object.

Example Code

// Bucket name, which consists of bucketname-appid (appid must be included), can be viewed in the COS console. https://console.tencentcloud.com/cos5/bucket
let bucket = "examplebucket-1250000000";
//The location identifier of an object in a bucket, also known as the object key
let cosPath = "exampleobject.txt";

let request = new HeadObjectRequest(bucket, cosPath); try { let result = await CosXmlBaseService.default().headObject(request) // The result includes http headers. Headers starting with 'x-cos-meta-*' are the metadata of the Object. } catch (e) { // Exception handling }


Ajuda e Suporte

Esta página foi útil?

comentários