Get object metadata (Swift SDK)
This topic describes how to query object metadata in a versioning-enabled Object Storage Service (OSS) bucket.
Notes
-
In this topic, the region ID
cn-hangzhouof the China (Hangzhou) region is used as an example. By default, the public endpoint for a region is used. If you want to access OSS from other Alibaba Cloud services in the same region as the OSS bucket, we recommend that you use an internal endpoint for the region. For more information about a list of regions and endpoints for OSS, see Regions and endpoints. -
To query object metadata, you must have the
oss:GetObjectpermission. For more information, see Attach a custom policy to a RAM user.
Sample code
References
-
For more information about the API operations for querying object metadata, see HeadObject and GetObjectMeta.