docs/Structs/Redirector.html
public struct Redirector
extension Redirector: RedirectHandler
Redirector is a convenience RedirectHandler making it easy to follow, not follow, or modify a redirect.
`
Behavior
`
Defines the behavior of the Redirector type.
Swift
public enum Behavior : Sendable
`
follow
`
Returns a Redirector with a .follow Behavior.
Swift
public static let follow: Redirector
`
doNotFollow
`
Returns a Redirector with a .doNotFollow Behavior.
Swift
public static let doNotFollow: Redirector
`
behavior
`
The Behavior of the Redirector.
Swift
public let behavior: Behavior
`
init(behavior:)
`
Creates a Redirector instance from the Behavior.
Swift
public init(behavior: Behavior)
| behavior |
The Behavior.
|
`
task(_:willBeRedirectedTo:for:completion:)
`
Swift
public func task(_ task: URLSessionTask,
willBeRedirectedTo request: URLRequest,
for response: HTTPURLResponse,
completion: @escaping (URLRequest?) -> Void)