AnyRedirectHandler
public struct AnyRedirectHandler : ImageDownloadRedirectHandler
A wrapper for creating an ImageDownloadRedirectHandler
easier.
This type conforms to ImageDownloadRedirectHandler
and wraps an redirect request modify block.
-
Declaration
Swift
public func handleHTTPRedirection( for task: SessionDataTask, response: HTTPURLResponse, newRequest: URLRequest, completionHandler: @escaping (URLRequest?) -> Void)
-
Creates a value of
ImageDownloadRedirectHandler
which runsmodify
block.Declaration
Swift
public init(handle: @escaping (SessionDataTask, HTTPURLResponse, URLRequest, (URLRequest?) -> Void) -> Void)
Parameters
modify
The request modifying block runs when a request modifying task comes.