I have a Webview in which I first load an URL, which will automatically redirect to https://secure.authorize.net/gateway/transact.dll.
But the delegate functions
neither
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
nor
-(NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse;
calling. So I got only a blank page.
Please help me in this.
I am using this function to load my Initial URL
myReq=[NSURLRequest requestWithURL:[NSURL URLWithString:myStr]];
NSURLConnection *myConn=[NSURLConnection connectionWithRequest:myReq delegate:self];
if(myConn){
webdata = [[NSMutableData alloc] init];
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
[webdata appendData:data];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
[[myWebView mainFrame] loadData:webdata MIMEType: @"text/html" textEncodingName: @"UTF-8" baseURL:nil];
}
I fixed this by resending the request whenever the server failed to load.
}
And now the delegate functions are called. I can trust the server here.
}