getSync method

Future<T> getSync({
  1. required TGGetRequest request,
})

Implementation

Future<T> getSync({required TGGetRequest request}) async {
  try {
    Uri uri = Uri.parse(request.getUrl());
    TGLog.t("GET", uri);
    final httpRes = await _getClient(request.getUri(), "GET")
        .get(uri, headers: request.headers());
    return Future.value(_prepareResponse(httpRes));
  } catch (error) {
    T t = _populateExceptionResponse(error);
    return Future.value(t);
  }
}