tencent cloud

APIs

GET Bucket (List Objects)

포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-04-14 10:44:39

Feature Description

GET Bucket requests are equivalent to List Objects requests, which can list some or all of the objects in the bucket. The requester of this API must have read permission for the bucket.
Note:
If you upload an object to the bucket and immediately call the GET Bucket API, due to the eventual consistency feature of this API, the returned results may not include the object you just uploaded.
If you are using a metadata acceleration bucket, please note the usage restrictions of the API.


Authorization Description

Set the action in the authorization policy to cos:GetBucket. View all action.

Request

Request Example

GET / HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String
Note:
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com, where <BucketName-APPID> is the bucket name suffixed with APPID, such as examplebucket-1250000000. Refer to Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Conventions; <Region> represents the COS region, see Regions and Access Endpoints.
Authorization: Auth String (For details, see Request Signature).

Request Parameter

Name
Description
Type
Required or Not
prefix
Object keys matching the prefix, limiting the response to only include object keys with the specified prefix.
string
No
delimiter
The delimiter, a single character, is used to group object keys. The identical portion from the prefix (or from the beginning if no prefix is specified) to the first delimiter in all object keys will be listed as a Prefix node under CommonPrefixes. Grouped object keys will not appear in subsequent object listings. For specific scenarios and usage, refer to the practical example below.
string
No
encoding-type
Specifies the encoding method for the returned value. Optional value: url, indicating that the returned object key is URL-encoded (percent-encoded). For example, "Tencent Cloud" will be encoded as %E8%85%BE%E8%AE%AF%E4%BA%91.
string
No
marker
The starting object key marker, after which (exclusive) object key entries are returned in UTF-8 lexicographical order.
string
No
max-keys
The maximum number of items returned in a single response. Default: 1000; Minimum: 0; Maximum: 1000.
Note:
The max-keys parameter limits the maximum number of items returned per List operation. COS returns no more than the number of items specified by max-keys (that is, the sum of CommonPrefixes and Contents) in each List response. If not all objects are listed in a single response, COS returns a NextMarker node. Use its value as the marker parameter in your next List request to retrieve subsequent objects.
integer
No

Request Header

This API only uses common request headers. For details, see Common Request Headers.

Request Body

This API has no request body.

Response

Response Headers

In addition to common response headers, this API returns the following response headers. For details about common response headers, see Common Response Headers.
Name
Description
Type
x-cos-bucket-region
The region of the bucket. For enumerated values, see Regions and Access Domains, such as ap-beijing, ap-hongkong, eu-frankfurt, and so on
Enum

Response Body

Upon a successful query, application/xml data is returned, containing object information in the bucket. For response bodies in different scenarios, see the practical examples below.
<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>string</Name>
<EncodingType>string</EncodingType>
<Prefix>string</Prefix>
<Marker>string</Marker>
<MaxKeys>integer</MaxKeys>
<Delimiter>string</Delimiter>
<IsTruncated>boolean</IsTruncated>
<NextMarker>string</NextMarker>
<CommonPrefixes>
<Prefix>string</Prefix>
</CommonPrefixes>
<CommonPrefixes>
<Prefix>string</Prefix>
</CommonPrefixes>
<Contents>
<Key>string</Key>
<LastModified>date</LastModified>
<ETag>string</ETag>
<Size>integer</Size>
<Owner>
<ID>string</ID>
<DisplayName>string</DisplayName>
</Owner>
<StorageClass>Enum</StorageClass>
<StorageTier>Enum</StorageTier>
<RestoreStatus>Enum</RestoreStatus>
</Contents>
<Contents>
<Key>string</Key>
<LastModified>date</LastModified>
<ETag>string</ETag>
<Size>integer</Size>
<Owner>
<ID>string</ID>
<DisplayName>string</DisplayName>
</Owner>
<StorageClass>Enum</StorageClass>
<StorageTier>Enum</StorageTier>
<RestoreStatus>Enum</RestoreStatus>
</Contents>
</ListBucketResult>
The detailed node descriptions are as follows:
Node Name (Keyword)
Parent Node
Description
Type
ListBucketResult
N/A
Stores all the information of the GET Bucket results.
Container
The content of the Container node ListBucketResult:
Node Name (Keyword)
Parent Node
Description
Type
Name
ListBucketResult
The bucket name in the format of <BucketName-APPID>, for example, examplebucket-1250000000.
string
EncodingType
ListBucketResult
The encoding format, corresponding to the encoding-type parameter in the request. This node is returned only if the encoding-type parameter is specified in the request.
string
Prefix
ListBucketResult
Object keys matching the prefix, corresponding to the prefix parameter in the request.
string
Marker
ListBucketResult
The starting object key marker, after which (exclusive) object key entries are returned in UTF-8 lexicographical order, corresponding to the marker parameter in the request.
string
MaxKeys
ListBucketResult
The maximum number of items returned in a single response, corresponding to the max-keys parameter in the request.
integer
Delimiter
ListBucketResult
The delimiter, corresponding to the delimiter parameter in the request. This node is returned only if the delimiter parameter is specified in the request.
string
IsTruncated
ListBucketResult
Indicates whether the response entries are truncated, a Boolean value, such as true and false.
boolean
NextMarker
ListBucketResult
This node is returned only when the response entries are truncated (IsTruncated is true). Its value represents the last object key in the current response entries. To retrieve subsequent entries, pass this node's value as the marker parameter in the next request.
string
CommonPrefixes
ListBucketResult
The identical portion from the prefix or from the beginning (if no prefix is specified) to the first delimiter is defined as the Common Prefix. This node may be returned only if the delimiter parameter is specified in the request.
Container
Contents
ListBucketResult
Object entries.
Container
Content of the Container node CommonPrefixes:
Node Name (Keyword)
Parent Node
Description
Type
Prefix
ListBucketResult.CommonPrefixes
The prefix of a single Common Prefix.
string
Content of the Container node Contents:
Node Name (Keyword)
Parent Node
Description
Type
Key
ListBucketResult.Contents
Object key.
string
LastModified
ListBucketResult.Contents
Last modified time of the object, in ISO8601 format, such as 2019-05-24T10:56:40Z.
date
ETag
ListBucketResult.Contents
The Entity Tag (ETag) of the object, which is an information tag identifying the object's content when it is created. It can be used to check whether the object's content has changed.
For example, "8e0b617ca298a564c3331da28dcb50df". This header does not necessarily return the MD5 value of the object, but varies depending on the object upload and encryption methods.
string
Size
ListBucketResult.Contents
Object size, in Byte.
integer
Owner
ListBucketResult.Contents
Object owner information.
Container
StorageClass
ListBucketResult.Contents
COS storage type. For enumerated values, see the Storage Type document, such as STANDARD_IA, ARCHIVE.
Enum
StorageTier
ListBucketResult.Contents
When the COS storage type is INTELLIGENT_TIERING, it indicates the current storage tier of the object. Enumerated values:
FREQUENT (frequent access tier).
INFREQUENT (infrequent access tier).
ARCHIVE_ACCESS (archive tier).
DEEP_ARCHIVE_ACCESS (deep archive tier).
This node is returned only when the StorageClass is INTELLIGENT_TIERING (Intelligent Tiering).
Enum
RestoreStatus
ListBucketResult.Contents
When the COS storage type is ARCHIVE or DEEP_ARCHIVE, it indicates the restore status of the object. Supported enumerated values: ONGOING, DONE, FAILED.
When no restore request is initiated for the object, this field is empty.
When a restore request is initiated, ONGOING indicates the restore is in progress, DONE indicates the restore is completed, and FAILED indicates the restore has failed.
This node is returned only when StorageClass is ARCHIVE (archive storage) or DEEP_ARCHIVE (deep archive storage), or when StorageClass is INTELLIGENT_TIERING (intelligent tiering) and StorageTier is ARCHIVE_ACCESS (archive tier) or DEEP_ARCHIVE_ACCESS (deep archive tier).
Enum
Content of the Container node Contents.Owner:
Node Name (Keyword)
Parent Node
Description
Type
ID
ListBucketResult.Contents.Owner
Owner's APPID.
string
DisplayName
ListBucketResult.Contents.Owner
Owner's name.
string

Error Codes

This API follows unified error responses and error codes. For details, see Error Codes.

Practical Case

Example One: Simple Case

Request

GET / HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Thu, 10 Dec 2020 03:37:41 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1607571461;1607578661&q-key-time=1607571461;1607578661&q-header-list=date;host&q-url-param-list=&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 2931
Connection: close
Date: Thu, 10 Dec 2020 03:37:41 GMT
Server: tencent-cos
x-cos-bucket-region: ap-beijing
x-cos-request-id: NWZkMTk4MDVfNjViODJhMDlfNDZkYl8xNzU0****

<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>examplebucket-1250000000</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>example-folder-1/example-object-1.jpg</Key>
<LastModified>2020-12-10T03:37:30.000Z</LastModified>
<ETag>&quot;f173c1199e3d3b53dd91223cae16fb42&quot;</ETag>
<Size>37</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>example-folder-1/example-object-2.jpg</Key>
<LastModified>2020-12-10T03:37:30.000Z</LastModified>
<ETag>&quot;c9d28698978bb6fef6c1ed1c439a17d3&quot;</ETag>
<Size>37</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>INTELLIGENT_TIERING</StorageClass>
<StorageTier>FREQUENT</StorageTier>
</Contents>
...
<Contents>
<Key>example-object-2.jpg</Key>
<LastModified>2020-12-10T03:37:30.000Z</LastModified>
<ETag>&quot;51370fc64b79d0d3c7c609635be1c41f&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD_IA</StorageClass>
</Contents>
<Contents>
<Key>example-object-3.jpg</Key>
<LastModified>2020-12-10T04:37:30.000Z</LastModified>
<ETag>&quot;51370fc64b79d0d3c7c609635be1c41f&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>ARCHIVE</StorageClass>
<RestoreStatus>DONE</RestoreStatus>
</Contents>
</ListBucketResult>

Case 2: with encoding-type parameter (object key using URL encoding)

Request

GET /?encoding-type=url HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Tue, 08 Dec 2020 13:54:16 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1607435656;1607442856&q-key-time=1607435656;1607442856&q-header-list=date;host&q-url-param-list=encoding-type&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 1220
Connection: close
Date: Wed, 09 Dec 2020 15:28:29 GMT
Server: tencent-cos
x-cos-bucket-region: ap-beijing
x-cos-request-id: NWZkMGVkMWRfZjdjNzJhMDlfMjJhYTlfYmJk****

<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>examplebucket-1250000000</Name>
<EncodingType>url</EncodingType>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>Tencent%20Cloud.jpg</Key>
<LastModified>2020-12-09T15:28:19.000Z</LastModified>
<ETag>&quot;ee8de918d05640145b18f70f4c3aa602&quot;</ETag>
<Size>16</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>%E7%85%A7%E7%89%87/2020%E5%B9%B4/IMG0001.jpg</Key>
<LastModified>2020-12-09T15:28:19.000Z</LastModified>
<ETag>&quot;ee8de918d05640145b18f70f4c3aa602&quot;</ETag>
<Size>16</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>%E8%85%BE%E8%AE%AF%E4%BA%91.jpg</Key>
<LastModified>2020-12-09T15:28:19.000Z</LastModified>
<ETag>&quot;ee8de918d05640145b18f70f4c3aa602&quot;</ETag>
<Size>16</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
</ListBucketResult>

Example 3: The delimiter Parameter Is Carried (Listing Objects and Subdirectories Under the Root Directory)

Request

GET /?delimiter=%2F HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Thu, 10 Dec 2020 03:37:41 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1607571461;1607578661&q-key-time=1607571461;1607578661&q-header-list=date;host&q-url-param-list=delimiter&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 1011
Connection: close
Date: Thu, 10 Dec 2020 03:37:41 GMT
Server: tencent-cos
x-cos-bucket-region: ap-beijing
x-cos-request-id: NWZkMTk4MDVfNjRiMDJhMDlfOTZjZV8xOTgw****

<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>examplebucket-1250000000</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<Delimiter>/</Delimiter>
<IsTruncated>false</IsTruncated>
<CommonPrefixes>
<Prefix>example-folder-1/</Prefix>
</CommonPrefixes>
<CommonPrefixes>
<Prefix>example-folder-2/</Prefix>
</CommonPrefixes>
<Contents>
<Key>example-object-1.jpg</Key>
<LastModified>2020-12-10T03:37:30.000Z</LastModified>
<ETag>&quot;0f0cd12c48979d1bf3f95255a36cb861&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>example-object-2.jpg</Key>
<LastModified>2020-12-10T03:37:30.000Z</LastModified>
<ETag>&quot;51370fc64b79d0d3c7c609635be1c41f&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD_IA</StorageClass>
</Contents>
</ListBucketResult>

Example 4: The prefix and delimiter Parameters Are Carried (Listing Objects and Subdirectories Under the Root Directory)

Request

GET /?prefix=example-folder-1%2F&delimiter=%2F HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Thu, 10 Dec 2020 03:37:41 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1607571461;1607578661&q-key-time=1607571461;1607578661&q-header-list=date;host&q-url-param-list=delimiter;prefix&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 1142
Connection: close
Date: Thu, 10 Dec 2020 03:37:41 GMT
Server: tencent-cos
x-cos-bucket-region: ap-beijing
x-cos-request-id: NWZkMTk4MDVfZGZjNzJhMDlfMzJiMjRfMTY0****

<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>examplebucket-1250000000</Name>
<Prefix>example-folder-1/</Prefix>
<Marker/>
<MaxKeys>1000</MaxKeys>
<Delimiter>/</Delimiter>
<IsTruncated>false</IsTruncated>
<CommonPrefixes>
<Prefix>example-folder-1/sub-folder-1/</Prefix>
</CommonPrefixes>
<CommonPrefixes>
<Prefix>example-folder-1/sub-folder-2/</Prefix>
</CommonPrefixes>
<Contents>
<Key>example-folder-1/example-object-1.jpg</Key>
<LastModified>2020-12-10T03:37:30.000Z</LastModified>
<ETag>&quot;f173c1199e3d3b53dd91223cae16fb42&quot;</ETag>
<Size>37</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>example-folder-1/example-object-2.jpg</Key>
<LastModified>2020-12-10T03:37:30.000Z</LastModified>
<ETag>&quot;c9d28698978bb6fef6c1ed1c439a17d3&quot;</ETag>
<Size>37</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>INTELLIGENT_TIERING</StorageClass>
<StorageTier>FREQUENT</StorageTier>
</Contents>
</ListBucketResult>

Case 5: Obtain the first page when pagination is required (in the case, max-keys is limited; if not limited, it defaults to 1000)

Request

GET /?max-keys=3 HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Tue, 08 Dec 2020 12:05:10 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1607429110;1607436310&q-key-time=1607429110;1607436310&q-header-list=date;host&q-url-param-list=max-keys&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 1195
Connection: close
Date: Tue, 08 Dec 2020 12:05:10 GMT
Server: tencent-cos
x-cos-bucket-region: ap-beijing
x-cos-request-id: NWZjZjZiZjZfZGRjODJhMDlfMWFjZDVfMTlmZTY5****

<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>examplebucket-1250000000</Name>
<Prefix/>
<Marker/>
<MaxKeys>3</MaxKeys>
<IsTruncated>true</IsTruncated>
<NextMarker>example-object-3.jpg</NextMarker>
<Contents>
<Key>example-object-1.jpg</Key>
<LastModified>2020-12-08T12:05:00.000Z</LastModified>
<ETag>&quot;0f0cd12c48979d1bf3f95255a36cb861&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>example-object-2.jpg</Key>
<LastModified>2020-12-08T12:05:00.000Z</LastModified>
<ETag>&quot;51370fc64b79d0d3c7c609635be1c41f&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>example-object-3.jpg</Key>
<LastModified>2020-12-08T12:05:00.000Z</LastModified>
<ETag>&quot;b2f1d893c5fde000ee8ea6eca18ed81f&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
</ListBucketResult>

Case 6: Obtaining Subsequent Pages When Pagination Is Needed (Continuing from Case 5)

Request

GET /?max-keys=3&marker=example-object-3.jpg HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Tue, 08 Dec 2020 12:05:11 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1607429111;1607436311&q-key-time=1607429111;1607436311&q-header-list=date;host&q-url-param-list=marker;max-keys&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 859
Connection: close
Date: Tue, 08 Dec 2020 12:05:11 GMT
Server: tencent-cos
x-cos-bucket-region: ap-beijing
x-cos-request-id: NWZjZjZiZjdfMjRhZjJhMDlfMjc2NV8xYmE2****

<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>examplebucket-1250000000</Name>
<Prefix/>
<Marker>example-object-3.jpg</Marker>
<MaxKeys>3</MaxKeys>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>example-object-4.jpg</Key>
<LastModified>2020-12-08T12:05:00.000Z</LastModified>
<ETag>&quot;e9ec8bcb980d2e4d8526c346eb3b2585&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>example-object-5.jpg</Key>
<LastModified>2020-12-08T12:05:00.000Z</LastModified>
<ETag>&quot;201669a14bdf051d8a9d6f9828d3f4c4&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
</ListBucketResult>

Case 7: Obtain the first page when pagination is required (with the delimiter parameter, and the total number of entries in CommonPrefixes and Contents does not exceed the value specified by max-keys)

Request

GET /?delimiter=%2F&max-keys=3 HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Wed, 09 Dec 2020 03:22:38 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1607484158;1607491358&q-key-time=1607484158;1607491358&q-header-list=date;host&q-url-param-list=delimiter;max-keys&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 486
Connection: close
Date: Wed, 09 Dec 2020 03:22:38 GMT
Server: tencent-cos
x-cos-bucket-region: ap-beijing
x-cos-request-id: NWZkMDQyZmVfYTJjMjJhMDlfYmQwOF8xYjkw****

<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>examplebucket-1250000000</Name>
<Prefix/>
<Marker/>
<MaxKeys>3</MaxKeys>
<Delimiter>/</Delimiter>
<IsTruncated>true</IsTruncated>
<NextMarker>example-folder-3/</NextMarker>
<CommonPrefixes>
<Prefix>example-folder-1/</Prefix>
</CommonPrefixes>
<CommonPrefixes>
<Prefix>example-folder-2/</Prefix>
</CommonPrefixes>
<CommonPrefixes>
<Prefix>example-folder-3/</Prefix>
</CommonPrefixes>
</ListBucketResult>

Case 8: Obtain subsequent pages when pagination is needed (with the delimiter parameter, continuing from Case 7)

Request

GET /?delimiter=%2F&max-keys=3&marker=example-folder-3%2F HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Wed, 09 Dec 2020 03:22:39 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1607484159;1607491359&q-key-time=1607484159;1607491359&q-header-list=date;host&q-url-param-list=delimiter;marker;max-keys&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 956
Connection: close
Date: Wed, 09 Dec 2020 03:22:39 GMT
Server: tencent-cos
x-cos-bucket-region: ap-beijing
x-cos-request-id: NWZkMDQyZmZfZmNhODBiMDlfZmM4N19jYmQz****

<?xml version='1.0' encoding='utf-8' ?>
<ListBucketResult>
<Name>examplebucket-1250000000</Name>
<Prefix/>
<Marker>example-folder-3/</Marker>
<MaxKeys>3</MaxKeys>
<Delimiter>/</Delimiter>
<IsTruncated>false</IsTruncated>
<CommonPrefixes>
<Prefix>example-folder-4/</Prefix>
</CommonPrefixes>
<Contents>
<Key>example-object-1.jpg</Key>
<LastModified>2020-12-09T03:22:28.000Z</LastModified>
<ETag>&quot;0f0cd12c48979d1bf3f95255a36cb861&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>example-object-2.jpg</Key>
<LastModified>2020-12-09T03:22:28.000Z</LastModified>
<ETag>&quot;51370fc64b79d0d3c7c609635be1c41f&quot;</ETag>
<Size>20</Size>
<Owner>
<ID>1250000000</ID>
<DisplayName>1250000000</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
</ListBucketResult>

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백