getx<T> method

Future<Response> getx<T>(
  1. String path, {
  2. Map<String, String>? headers,
})

Implementation

Future<Response> getx<T>(String path, {Map<String, String>? headers}) async {
  try {
    var response = await get(
      Uri.parse(path),
      headers: headers,
    );
    return Future.value(response);
  } on FormatException catch (_) {
    throw const FormatException("Unable to process the data");
  } catch (e) {
    log(e.toString());
    rethrow;
  }
}