getSignedUrl method

Future<Uri> getSignedUrl({
  1. SignedUrlAction action = SignedUrlAction.read,
  2. required Duration expires,
  3. String? contentType,
  4. Map<String, String>? headers,
  5. Map<String, String>? queryParams,
})

Creates a V4 signed URL for this object.

expires is measured from now and must be at most 7 days. Requires the app to be initialized with a service account credential that includes a private key. Optional contentType / headers must also be sent by the client when using the URL.

Implementation

Future<Uri> getSignedUrl({
  SignedUrlAction action = SignedUrlAction.read,
  required Duration expires,
  String? contentType,
  Map<String, String>? headers,
  Map<String, String>? queryParams,
}) async {
  return createSignedUrl(
    app: bucket._storage.app,
    bucketName: bucket.name,
    objectName: name,
    action: action,
    expires: expires,
    contentType: contentType,
    headers: headers,
    queryParams: queryParams,
  );
}