head<T> method

Future head<T>(
  1. String url, {
  2. Map<String, dynamic>? params,
  3. Options? options,
  4. CancelToken? cancelToken,
  5. OnSuccess? onSuccess,
  6. OnFailed? onFailed,
  7. OnCommon? onCommon,
  8. dynamic bind,
})

HEAD 请求

@param url 请求地址
@param params 请求参数(可选)
@param options 请求额外设置,包括Header等(可选)
@param cancelToken 取消请求时使用的CancelToken(可选)
@param onSuccess 请求成功回调方法(可选)
@param onFailed 请求失败回调方法(可选)
@param onCommon 公共回调方法,成功和失败都会调用,在onSuccess和onFailed之前调用(可选)

Implementation

Future<dynamic> head<T>(
  String url, {
  Map<String, dynamic>? params,
  Options? options,
  CancelToken? cancelToken,
  OnSuccess? onSuccess,
  OnFailed? onFailed,
  OnCommon? onCommon,
  dynamic bind,
}) async {
  return _client!
      .head<T>(
        _handleUrl(url, params),
        data: _handleParams(url, params),
        options: _bindCancelToken(options, bind),
        cancelToken: cancelToken,
      )
      ._handleCallback(onSuccess, onFailed, onCommon);
}