1

How can I get the HTTP status field from a WebView in Swift 2?

I tried this:

func webViewDidFinishLoad(webView: UIWebView) {
    let status = webView.request?.valueForHTTPHeaderField("Status")
    print("Status: \(status)")
}

But status remains nil.

O.Olivier
  • 230
  • 2
  • 12

1 Answers1

0

You should try to log all the fields you can get from this http response. Here is a link that might be usefull : Get HTTP Response header on UIWebView

Community
  • 1
  • 1
Damien
  • 3,322
  • 3
  • 19
  • 29