RequestDelegate - SwiftDocOrg/Alamofire GitHub Wiki
RequestDelegate
Protocol abstraction for Request's communication back to the SessionDelegate.
public protocol RequestDelegate: AnyObject
Inheritance
AnyObject
Requirements
sessionConfiguration
URLSessionConfiguration used to create the underlying URLSessionTasks.
var sessionConfiguration: URLSessionConfiguration
startImmediately
Determines whether the Request should automatically call resume() when adding the first response handler.
var startImmediately: Bool
cleanup(after:)
Notifies the delegate the Request has reached a point where it needs cleanup.
func cleanup(after request: Request)
Parameters
- request: The
Requestto cleanup after.
retryResult(for:dueTo:completion:)
Asynchronously ask the delegate whether a Request will be retried.
func retryResult(for request: Request, dueTo error: AFError, completion: @escaping (RetryResult) -> Void)
Parameters
- request:
Requestwhich failed. - error:
Errorwhich produced the failure. - completion: Closure taking the
RetryResultfor evaluation.
retryRequest(_:withDelay:)
Asynchronously retry the Request.
func retryRequest(_ request: Request, withDelay timeDelay: TimeInterval?)
Parameters
- request:
Requestwhich will be retried. - timeDelay:
TimeIntervalafter which the retry will be triggered.