getService method

Future<COSListAllMyBucketsResult> getService({
  1. String? region,
})

GET Service 接口是用来查询请求者名下的所有存储桶列表或特定地域下的存储桶列表 region

Implementation

Future<COSListAllMyBucketsResult> getService({String? region}) async {
  String authority = 'service.cos.myqcloud.com';
  if (region?.isNotEmpty ?? false) {
    authority = 'cos.$region.myqcloud.com';
  }
  final Uri url = Uri.https(authority, '/');
  final Response response = await client.get(url.toString());
  return toXml<COSListAllMyBucketsResult>(response)(
      COSListAllMyBucketsResult.fromXml);
}