我正在与执行 304 重定向的 REST API 作斗争;我需要的是获取重定向的目标 URL 并用浏览器打开它(我知道,这有点变态)。我成功拦截了重定向,这要归功于这个可爱的小伙子 reversepanda: https ://github.com/bustoutsolutions/siesta/issues/210 但我仍然不知道如何在 GET 请求的回调中获取重定向 URL(成功或失败)
resource.load().onSuccess{ response in
//HERE I WOULD LIKE TO TAKE THE URL OF THE REDIRECT
//(if I print the response I can see the HTML of the destination web page where the user should land)
}.onFailure{ error in
//using 'completionHandler(nil)' in the 'willPerformHTTPRedirection' method of the delegate, brings me here
}
关于如何解决这个问题的任何建议?
谢谢!