api<T> method

  1. @override
Future<ApiResult<T>> api<T>(
  1. IReturn<T> request, {
  2. Map<String, dynamic>? args,
  3. String? method,
})
override

Implementation

@override
Future<ApiResult<T>> api<T>(IReturn<T> request,
    {Map<String, dynamic>? args, String? method}) async {
  try {
    var result =
        await fetch<T>(method ?? resolveHttpMethod(request), request, args);
    return ApiResult<T>(response: result);
  } on Exception catch (e) {
    return new ApiResult<T>(error: getResponseStatus(e));
  }
}