postCached<T> method

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

Gets locally saved last response from the path

Implementation

Future<Response<T>> postCached<T>(
  String path, {
  data,
  Map<String, dynamic>? queryParameters,
  Options? options,
  CancelToken? cancelToken,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  final requestOptions = RequestOptions(
    path: path,
    queryParameters: queryParameters,
    data: data,
    headers: super.options.headers,
  );

  return Response(
    requestOptions: requestOptions,
    data: await _getDataFromCache(requestOptions),
  );
}