get method
Future<T>
get({
- required TGGetRequest request,
- dynamic onSuccess(
- dynamic T
- dynamic onError(
- dynamic T
Implementation
Future<T> get(
{required TGGetRequest request, onSuccess(T)?, onError(T)?}) 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 _performCallback(httpRes, onError, onSuccess);
} catch (error) {
T t = _populateExceptionResponse(error);
onError!(t);
return t;
}
}