deleteData method

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

Implementation

Future<Response> deleteData(String endpoint,
    {Map<String, dynamic>? headers}) async {
  try {
    _dio.options.headers['content-Type'] = 'application/json';
    _dio.options.headers['authorization'] = _bearerToken;
    final response = await _dio.get(
      Uri.encodeFull(endpoint),
      options: Options(headers: headers),
    );
    return response;
  } on DioError catch (e) {
    throw handleException(e);
  } catch (e) {
    debugPrint("ERROR postData $e");
    throw Exception(e);
  }
}