put<T> method

Future<Response<T>> put<T>(
  1. String path,
  2. {dynamic data,
  3. Map<String, dynamic> queryParameters,
  4. Options options,
  5. CancelToken cancelToken,
  6. ProgressCallback onSendProgress,
  7. ProgressCallback onReceiveProgress}
)

Handy method to make http PUT request, which is a alias of BaseDio.request.

Implementation

Future<Response<T>> put<T>(
  String path, {
  data,
  Map<String, dynamic> queryParameters,
  Options options,
  CancelToken cancelToken,
  ProgressCallback onSendProgress,
  ProgressCallback onReceiveProgress,
}) async {
  if (!loadAppAndLoadBalancerIfNeed())
    throw CustomError('未找到对应的服务[id=$serviceId]');
  return _loadBalancer?.run(
    path,
    data: data,
    queryParameters: queryParameters,
    options: checkOptions('PUT', options),
    onReceiveProgress: onReceiveProgress,
    onSendProgress: onSendProgress,
    cancelToken: cancelToken,
  );
}