getPresignedUrl method

Future<String> getPresignedUrl(
  1. String bucket,
  2. String cosPath, {
  3. int? signValidTime,
  4. bool? signHost,
  5. Map<String?, String?>? parameters,
  6. String? region,
})

获取get请求预签名链接 bucket 存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket cosPath 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "video/xxx/movie.mp4" signValidTime 设置签名有效期(单位为秒),注意这里是签名有效期,您需要自行保证密钥有效期 signHost 是否签入Header Host,不签可能导致请求失败或安全漏洞 parameters http请求参数,传入的请求参数需与实际请求相同,能够防止用户篡改此HTTP请求的参数

Implementation

Future<String> getPresignedUrl(
    String bucket,
    String cosPath,
    {
    int? signValidTime,
    bool? signHost,
    Map<String?, String?>? parameters,
    String? region
    }
) {
  return cosApi.getPresignedUrl(serviceKey, bucket, cosPath, signValidTime, signHost, parameters, region);
}