deleteBlob method

Future<void> deleteBlob(
  1. String path, {
  2. BlobType type = BlobType.BlockBlob,
})

Implementation

Future<void> deleteBlob(String path,
    {BlobType type = BlobType.BlockBlob}) async {
  var request = http.Request('DELETE', uri(path: path));
  request.headers['x-ms-blob-type'] =
      type.toString() == 'BlobType.AppendBlob' ? 'AppendBlob' : 'BlockBlob';
  _sign(request);
  var res = await request.send();
  if (res.statusCode == 202) {
    return;
  }

  var message = await res.stream.bytesToString();
  throw AzureStorageException(message, res.statusCode, res.headers);
}