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);
}