postAsync<T> method

Future<Response<T>> postAsync<T>(
  1. String path, {
  2. dynamic data,
  3. Options? options,
  4. dynamic life,
  5. ProgressCallback? onSendProgress,
  6. ProgressCallback? onReceiveProgress,
})

Implementation

Future<Response<T>> postAsync<T>(String path, {data, Options? options, dynamic life, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) async {
  if (life == null) life = DateTime.now().millisecondsSinceEpoch.toString();
  var cancelToken = addLife(life);
  Response<T> future = await _dio.post(path, data: data, options: options, onSendProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress, cancelToken: cancelToken);
  _removeLife(life);
  return future;
}