deleteRequest method

Future<Map> deleteRequest(
  1. String path
)

Make delete request to api

Returns Map of the response. Throws an ApiException if the request is unsuccessful.

Implementation

Future<Map> deleteRequest(String path) async {
  final uri = getCausesApiPath(path);
  print("Making request: ${uri.toString()}, headers: ${getRequestHeaders()}");
  http.Response response = await client.put(
    uri,
    headers: getRequestHeaders(),
  );

  if (response.statusCode >= 400) {
    throw getExceptionForResponse(response);
  }

  return await json.decode(response.body);
}