put static method

Future put(
  1. String path, {
  2. bool isAuth = false,
  3. bool testMode = false,
  4. dynamic body,
  5. Map<String, String>? headers,
  6. Map<String, dynamic>? query,
  7. CancelToken? cancelToken,
  8. ResponseType responseType = ResponseType.map_data,
  9. dynamic onSendProgress(
    1. int,
    2. int
    )?,
  10. dynamic onReceiveProgress(
    1. int,
    2. int
    )?,
  11. bool ignoreOnAllError = false,
  12. int urlIndex = 0,
})

Sends an HTTP PUT request.

Implementation

static Future<dynamic> put(String path,
    {bool isAuth = false,
    bool testMode = false,
    dynamic body,
    Map<String, String>? headers,
    Map<String, dynamic>? query,
    CancelToken? cancelToken,
    ResponseType responseType = ResponseType.map_data,
    Function(int, int)? onSendProgress,
    Function(int, int)? onReceiveProgress,
    bool ignoreOnAllError = false,
    int urlIndex = 0}) async {
  String error = _checkBeforeRequest(isAuth, urlIndex);
  if (error.isNotEmpty) {
    throw APIException(-1, body: error);
  }
  bool isUrl = path.startsWith('http');
  return await DioApiST.instance.request(
      type: 'PUT',
      method: !isUrl ? path : null,
      baseUrl: isUrl ? path : null,
      isAuth: isAuth,
      testMode: testMode,
      headers: headers,
      queries: query,
      responseType: responseType,
      cancelToken: cancelToken,
      data: body,
      onReceiveProgress: onReceiveProgress,
      onSendProgress: onSendProgress,
      ignoreOnAllError: ignoreOnAllError,
      urlIndex: urlIndex);
}