delete<T> method

  1. @override
Future<HttpResponse<T>> delete<T>({
  1. required Uri apiUri,
  2. Map<String, String>? headers,
  3. Map<String, dynamic>? body,
})
override

Implementation

@override
Future<HttpResponse<T>> delete<T>({
  required Uri apiUri,
  Map<String, String>? headers,
  Map<String, dynamic>? body,
}) async {
  debugPrint('----HttpService: DELETE API call-----');
  try {
    final response = await _dio.delete<T>(
      apiUri.toString(),
      data: body,
      options: Options(headers: headers),
    );
    return _toHttpResponse(dioResponse: response);
  } on DioException catch (e) {
    debugPrint('----HttpService: DELETE Error: $apiUri ${e.message}-----');
    return _buildErrorResponse<T>(e, apiUri.toString());
  }
}