RequestInterceptor

public protocol RequestInterceptor

a protocol intercepting a session request

  • Should be called before making the request to provide modifications to request

    Declaration

    Swift

    func adaptRequest<Output>(_ request: Request<Output>) -> Request<Output>
  • catch and retry a failed request

    Declaration

    Swift

    func rescueRequest<Output>(_ request: Request<Output>, error: Error) -> AnyPublisher<Void, Error>?

    Return Value

    nil if the request should not be retried. Otherwise a publisher that will be executed before retrying the request