deleteContainer method

Future<void> deleteContainer(
  1. String name, {
  2. int? timeout,
})

Implementation

Future<void> deleteContainer(String name, {int? timeout}) async {
  assert(name.trim().isNotEmpty);
  String path = 'https://${config[accountName]}.blob.core.windows.net/$name?restype=container';
  if (timeout != null) path += '&timeout=$timeout';
  var request = http.Request('DELETE', Uri.parse(path));
  // request.headers['x-ms-meta-Name']='StorageSample';
  _sign4BlobAdmin(request, name);
  var res = await request.send();
  if (res.statusCode >= 200 && res.statusCode < 300) {
    return;
  }
  var message = await res.stream.bytesToString();
  throw AzureStorageException(message, res.statusCode, res.headers);
}