开发者

NSURLConnection basic authentication issues with didReceiveAuthenticationChallenge

开发者 https://www.devze.com 2023-03-20 06:02 出处:网络
Running into some weird issues with didReceiveAuthenticationChallenge. If I do something like: NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:WAF_URL]

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

精彩评论

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