getUpdatedRequest method

  1. @override
  2. @protected
FutureOr<BaseRequest> getUpdatedRequest(
  1. BaseRequest originalRequest,
  2. BaseRequest lastRequest,
  3. FinalizedBodyStreamCallback bodyStream,
  4. BaseResponse? response,
  5. int retryCount,
)
override

Returns an updated request that should be retried

Implementation

@override
@protected
FutureOr<BaseRequest> getUpdatedRequest(
  BaseRequest originalRequest,
  BaseRequest lastRequest,
  FinalizedBodyStreamCallback bodyStream,
  BaseResponse? response,
  int retryCount,
) {
  final updateRequest = this.updateRequest;
  if (updateRequest != null) {
    return updateRequest(
      originalRequest,
      lastRequest,
      bodyStream,
      response,
      retryCount,
    );
  }
  return super.getUpdatedRequest(
    originalRequest,
    lastRequest,
    bodyStream,
    response,
    retryCount,
  );
}