- Documentation
Torch Object Storage
SDK Reference
C++
Bucket Interface
Basic Bucket Interface
Retrieving Bucket Metadata (C++ SDK)
Basic Bucket Interface
Retrieving Bucket Metadata (C++ SDK)
Retrieving Bucket Metadata (C++ SDK)
HeadBucket is used to retrieve information about a storage bucket (Bucket). Additionally, you can use the returned TosError to check the HTTP Code and determine whether the bucket exists.
Precautions
- Before you can obtain bucket metadata, you must have the tos:HeadBucket permission. For detailed instructions, please refer to the Permission Configuration Guide.
- If the bucket does not exist, this interface will return a 404 error. This mechanism is also commonly used to verify the existence of a bucket.
Sample Code
The following code is used to obtain the metadata of the examplebucket bucket.
Relevant Documents
For API documentation on retrieving bucket metadata, see HeadBucket. Last updated: 2025.09.25 14:22:45