putUri<T> method
Future<BasicModel>
putUri<
T>( - Uri uri, {
- Object? data,
- dynamic tag,
- bool? loading,
- bool dataToJson = true,
- dynamic options,
- dynamic onSendProgress,
- dynamic onReceiveProgress,
- dynamic cancelToken,
})
Implementation
Future<BasicModel> putUri<T>(
Uri uri, {
Object? data,
dynamic tag,
bool? loading,
bool dataToJson = true,
Options? options,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
CancelToken? cancelToken,
}) async {
assert(_singleton != null, '请先调用 initialize');
if (hasNetWork) return notNetWorkModel;
_addLoading(loading);
data = basicDioOptions.extraUriData?.call(uri, data) ?? data;
uri = basicDioOptions.extraUri?.call(uri) ?? uri;
final res = await dio.putUri<T>(uri,
options: _initBasicOptions(options, uri.path),
onReceiveProgress: onReceiveProgress,
onSendProgress: onSendProgress,
cancelToken: cancelToken,
data: dataToJson ? jsonEncode(data) : data);
return _response(res, tag);
}