NSURLErrorDomain -1012 with NSURLAuthenticationChallenge
NSURLErrorDomain -1012 with NSURLAuthenticationChallenge
- Subject: NSURLErrorDomain -1012 with NSURLAuthenticationChallenge
- From: "Karim Gorjux" <email@hidden>
- Date: Thu, 17 Aug 2006 23:00:27 +0300
Hi people!
I trying to connect with NSUrlConnection that works fine with normal sites
like my blog, but if I try to use something with authentication like
delicious's api i get this error:
Error NSURLErrorDomain -1012
The delegate method:
-(void)connection:(NSURLConnection *)connection
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
NSLog(@"Ask for authorization");
if ([challenge previousFailureCount] == 0) {
NSLog(@"defaults credentialt");
NSURLCredential *newCredential;
newCredential = [NSURLCredential credentialWithUser:@"xxxx"
password:@"xxxxx"
persistence:NSURLCredentialPersistenceNone];
[[challenge sender] useCredential:newCredential
forAuthenticationChallenge:challenge];
} else {
NSLog(@"Something fail = %d", [challenge previousFailureCount]);
[[challenge sender] cancelAuthenticationChallenge:challenge];
}
}
With safari the connection works good, but with the same url my code miss.
Thanks in advance.
Cheers
--
Karim Gorjux
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden