deletex<T> method

Future<Response> deletex<T>(
  1. String path, {
  2. Map<String, String>? headers,
  3. Object? body,
})

Implementation

Future<Response> deletex<T>(String path,
    {Map<String, String>? headers, Object? body}) async {
  try {
    if (headers != null) {
      headers = Map.from(headers)..addAll(headerDefault);
    } else {
      headers = headerDefault;
    }
    var response =
        await delete(Uri.parse(path), headers: headers, body: body);
    return Future.value(response);
  } on FormatException catch (_) {
    throw const FormatException("Unable to process the data");
  } catch (e) {
    log(e.toString());
    rethrow;
  }
}