delete method

Future<Map<String, dynamic>> delete(
  1. String endpoint, {
  2. Map<String, String>? headers,
})

Makes a DELETE request to the specified endpoint

Implementation

Future<Map<String, dynamic>> delete(
  String endpoint, {
  Map<String, String>? headers,
}) async {
  final uri = _buildUri(endpoint);
  final request = http.Request('DELETE', uri);

  if (headers != null) {
    request.headers.addAll(headers);
  }

  return _executeRequest(request);
}