get method

Future<Response> get({
  1. required String url,
  2. Map<String, String> headers = const {},
  3. dynamic body,
})

Implementation

Future<Response> get({
  required String url,
  Map<String, String> headers = const {},
  dynamic body,
}) async {
  try {
    final Response response = await _dioClient.get(
      url,
      options: Options(headers: headers),
      data: body,
    );
    return response;
  } on DioException catch (e) {
    final Response? response = e.response;
    if (response != null) {
      return response;
    }
    rethrow;
  }
}