RequestDelegate

public protocol RequestDelegate : AnyObject

Protocol abstraction for Request‘s communication back to the SessionDelegate.

  • URLSessionConfiguration used to create the underlying URLSessionTasks.

    Declaration

    Swift

    var sessionConfiguration: URLSessionConfiguration { get }
  • Asynchronously ask the delegate whether a Request will be retried.

    Declaration

    Swift

    func retryResult(for request: Request, dueTo error: Error, completion: @escaping (RetryResult) -> Void)

    Parameters

    request

    Request which failed.

    error

    Error which produced the failure.

    completion

    Closure taking the RetryResult for evaluation.

  • Asynchronously retry the Request.

    Declaration

    Swift

    func retryRequest(_ request: Request, withDelay timeDelay: TimeInterval?)

    Parameters

    request

    Request which will be retried.

    timeDelay

    TimeInterval after which the retry will be triggered.