Redirector
public struct Redirector
Redirector is a convenience RedirectHandler making it easy to follow, not follow, or modify a redirect.
-
Defines the behavior of the
Redirectortype.- follow: Follows the redirect as defined in the response.
- doNotFollow: Does not follow the redirect defined in the response.
- modify: Modifies the redirect request defined in the response.
Declaration
Swift
public enum Behavior -
Returns a
Redirectorwith a followBehavior.Declaration
Swift
public static let follow: Redirector -
Returns a
Redirectorwith a do not followBehavior.Declaration
Swift
public static let doNotFollow: Redirector
-
Declaration
Swift
public func task(_ task: URLSessionTask, willBeRedirectedTo request: URLRequest, for response: HTTPURLResponse, completion: @escaping (URLRequest?) -> Void)
View on GitHub
Install in Dash
Redirector Structure Reference