<!--
{
  "availability" : [
    "iOS: 14.5.0 -",
    "iPadOS: 14.5.0 -",
    "macCatalyst: 14.5.0 -",
    "macOS: 11.3.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKDownloadDelegate/download(_:willPerformHTTPRedirection:newRequest:decisionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKDownloadDelegate(im)download:willPerformHTTPRedirection:newRequest:decisionHandler:"
  },
  "title" : "download(_:willPerformHTTPRedirection:newRequest:decisionHandler:)"
}
-->

# download(_:willPerformHTTPRedirection:newRequest:decisionHandler:)

Asks the delegate to respond to the download’s redirect response.

```
optional func download(_ download: WKDownload, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, decisionHandler: @escaping @MainActor @Sendable (WKDownload.RedirectPolicy) -> Void)
```

## Parameters

`download`

The download that receives the redirect response.

`response`

The redirect response.

`request`

The new request the web view sends as a result of the redirect response.

`decisionHandler`

A closure you must invoke, providing a download redirect policy that indicates whether to proceed with the redirect.

## Discussion

Determine whether to proceed with the redirect. Then invoke the decisionHandler closure, providing a download redirect policy that indicates whether to proceed with the redirect.

If you don’t implement this method, the web view proceeds with all redirects.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)