getUri<T> method

Future<BaseModel> getUri<T>(
  1. Uri uri, {
  2. dynamic tag,
  3. Object? data,
  4. bool? loading,
  5. Options? options,
  6. CancelToken? cancelToken,
})

Implementation

Future<BaseModel> getUri<T>(
  Uri uri, {
  dynamic tag,
  Object? data,
  bool? loading,
  Options? options,
  CancelToken? cancelToken,
}) async {
  assert(_singleton != null, '请先调用 initialize');
  if (hasNetWork) return notNetWorkModel;
  _addLoading(loading);
  uri = baseDioOptions.extraUri?.call(uri) ?? uri;
  final res = await dio.getUri<T>(uri,
      data: data,
      cancelToken: cancelToken,
      options: _mergeOptions(options, uri.path));
  return _response(res, tag);
}