Back to Alamofire

Redirector

docs/Structs/Redirector.html

5.12.01.6 KB
Original Source

Redirector

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.

See more

Declaration

Swift

public enum Behavior : Sendable

`

                follow
                `

Returns a Redirector with a .follow Behavior.

Declaration

Swift

public static let follow: Redirector

`

                doNotFollow
                `

Returns a Redirector with a .doNotFollow Behavior.

Declaration

Swift

public static let doNotFollow: Redirector

`

                behavior
                `

The Behavior of the Redirector.

Declaration

Swift

public let behavior: Behavior

`

                init(behavior:)
                `

Creates a Redirector instance from the Behavior.

Declaration

Swift

public init(behavior: Behavior)

Parameters

| behavior |

The Behavior.

|

`

                task(_:willBeRedirectedTo:for:completion:)
                `

Declaration

Swift

public func task(_ task: URLSessionTask,
                 willBeRedirectedTo request: URLRequest,
                 for response: HTTPURLResponse,
                 completion: @escaping (URLRequest?) -> Void)