deleteTableRow method

Future<void> deleteTableRow({
  1. required String tableName,
  2. required String partitionKey,
  3. required String rowKey,
})

Delete table entity.

'tableName', partitionKey and rowKey are all mandatory.

Implementation

Future<void> deleteTableRow({
  required String tableName,
  required String partitionKey,
  required String rowKey,
}) async {
  String path = 'https://${config[accountName]}.table.core.windows.net/$tableName(PartitionKey=\'$partitionKey\', RowKey=\'$rowKey\')';
//    print('delete path: $path');
  var request = http.Request('DELETE', Uri.parse(path));
  request.headers['Accept'] = 'application/json;odata=nometadata';
  request.headers['Content-Type'] = 'application/json';
  request.headers['If-Match'] = '*';
  _sign4Tables(request);
  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);
}