- Notifications
You must be signed in to change notification settings - Fork396
Open
Description
This code is in ViewController.swift file in demo. I am not able to get this api log because it is called using URLSession. Please check.
`
func testRedirect() {
let request = URLRequest(url: URL(string: "https://www.google.com")!, cachePolicy: .reloadIgnoringLocalCacheData) let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { completionHandler(false, error.localizedDescription) return } if let httpResponse = response as? HTTPURLResponse { if (300...302).contains(httpResponse.statusCode) { completionHandler(true, httpResponse.allHeaderFields["Location"] as! String) return } } completionHandler(false, "Redirect request failed") } task.resume()}`
Metadata
Metadata
Assignees
Labels
No labels