API | Operation Name | Operation Description |
List Objects | List partial or all objects in this bucket. |
// Bucket name, which consists of bucketname-appid (appid must be included), can be viewed in the COS console. https://console.tencentcloud.com/cos5/bucketlet bucket = "examplebucket-1250000000";let request = new ListObjectsRequest(bucket);// Obtain all files in the dir directory: request.prefix = "dir/"// Obtain all files in the root directory: request.prefix = "";request.prefix = "dir/"try {let result = await CosXmlBaseService.default().listObject(request)// result includes http headers, etc.} catch (e) {// Exception// Processing}
Feedback