Tells the delegate that the remote server requested an HTTP redirect.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The session containing the task whose request resulted in a redirect.
The task whose request resulted in a redirect.
An object containing the server’s response to the original request.
A URL request object filled out with the new location.
A block that your handler should call with either the value of the
requestparameter, a modified URL request object, or
NULLto refuse the redirect and return the body of the redirect response.
This method is called only for tasks in default and ephemeral sessions. Tasks in background sessions automatically follow redirects.