开发者

NSURLConnection basic authentication issues with didReceiveAuthenticationChallenge

Running into some weird issues with didReceiveAuthenticationChallenge. If I do something like:

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:WAF_URL] 
                                                       cachePolicy:NSURLRequestReloadIgnoringCacheData 
                                                   timeoutInterval:60];
[request setHTTPShouldHandleCookies:NO];
self.conn = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 

I receive - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge challenge which if successful, trigge开发者_C百科rs connectionDidFinishLoading.

But, if I try to do a post with the request, I seem to be running into issue where my connectionDidFinishLoading is never triggered and my request times out.

This seems to be an issue only on iPhone and not on the simulator??!


My server was using NTLM challenge, which when used with Post with NSURLConnection screwed up. Removed that and it's fixed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜