Feature Overview
This API is used to query which region a bucket resides in. This GET request obtains the region with the
location parameter. Only the bucket owner has permission to call this API.Requests
Sample Request
GET /?location HTTP/1.1Host: <Bucketname-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth String
Note
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com, where <BucketName-APPID> is the bucket name with the APPID suffix, such as examplebucket-1250000000. You can refer to the Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Convention documentation. <Region> represents the available regions for COS, which can be found in the Regions and Access Domain Names documentation.
Authorization: Auth String (For more information, see Request Signature).
Request Header
Common Header
Non-common Header
This request operation has no special request headers.
Request Body
The request body of this request is empty.
Response
Response Header
Common Response Header
Special Response Header
This response has no special response headers.
Response Body
The region is returned in the response body.
<?xml version="1.0" encoding="UTF-8" ?><LocationConstraint>cos.ap-beijing</LocationConstraint>
The nodes are described as follows:
Node Name (Keyword) | Parent Node | Description | Local Disk Types | Required |
LocationConstraint | - | Specify the bucket's region, with enumerated values referring to the Regions and Access Domain Names document, such as: ap-beijing, ap-hongkong, eu-frankfurt, etc. | string | Required |
Error Codes
There are no specific error messages for this request operation. For common error messages, see Error Codes.
Examples
Requests
GET /?location HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Wed, 18 Oct 2014 22:32:00 GMTAuthorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1484817522;32557713522&q-key-time=1484817522;32557713522&q-header-list=host&q-url-param-list=location&q-signature=***********************************************
Response
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 92Connection: keep-aliveDate: Wed, 18 Oct 2014 22:32:00 GMTServer: tencent-cosx-cos-request-id: NTg4MDg0NzlfNDYyMDRlXzM0OWFf****<LocationConstraint>cos.ap-beijing</LocationConstraint>