public protocol ImageDownloadRedirectHandler
Represents and wraps a method for modifying request during an image download request redirection.
ImageDownloadRedirectHandlercontained will be used to change the request before redirection. This is the posibility you can modify the image download request during redirection. You can modify the request for some customizing purpose, such as adding auth token to the header, do basic HTTP auth or something like url mapping.
Usually, you pass an
ImageDownloadRedirectHandleras the associated value of
KingfisherOptionsInfoItem.redirectHandlerand use it as the
optionsparameter in related methods.
If you do nothing with the input
requestand return it as is, a downloading process will redirect with it.
func handleHTTPRedirection(for task: SessionDataTask, response: HTTPURLResponse, newRequest: URLRequest, completionHandler: @escaping (URLRequest?) -> Void)
SessionDataTaskwhich triggers this redirect.
The response received during redirection.
The request for redirection which can be modified.
A closure for being called with modified request.