Querying Object Metadata

Last updated: 2020-09-14 11:37:32


    This document provides an overview of APIs and SDK code samples related to querying object metadata.

    API Operation Description
    HEAD Object Querying object metadata Queries the metadata of an object

    SDK API Reference

    For the parameters and method descriptions of all the APIs in the SDK, see Api Documentation.

    Querying object metadata

    API description

    This API is used to query the metadata of an object.

    Sample code

      string bucket = "examplebucket-1250000000"; // Bucket name in the format: BucketName-APPID
      string key = "exampleobject"; // Object key
      HeadObjectRequest request = new HeadObjectRequest(bucket, key);
      // Execute the request
      HeadObjectResult result = cosXml.HeadObject(request);
      // Request succeeded
    catch (COSXML.CosException.CosClientException clientEx)
      // Request failed
      Console.WriteLine("CosClientException: " + clientEx);
    catch (COSXML.CosException.CosServerException serverEx)
      // Request failed
      Console.WriteLine("CosServerException: " + serverEx.GetInfo());


    For the complete sample, go to GitHub.