基本身份验证不会调用willSendRequestForAuthenticationChallenge

时间:2013-06-29 14:00:28

标签: ios uiwebview nsurlconnection basic-authentication

设置:

  • One Page iOS应用程序
  • UIWebView with NSURLConnectionDelegate

使用基本身份验证调用两个不同的服务器会导致两种不同的行为。

通过

访问http://test.webdav.org/auth-basic/
_request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://test.webdav.org/auth-basic/"]]

委托方法:

- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge` 

被召唤。

但是通过

访问http://browserspy.dk/password-ok.php
_request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://browserspy.dk/password-ok.php"]];

不会调用委托方法。 这两个测试网站之间有什么区别?

0 个答案:

没有答案
相关问题