I wanted to know if the server should have special setting to work with nsurlconnections? When I tried creating a connection and authentication. I don’t get any error or warning but it does not connected.
Could any one please clarify me on this.
Thanks
Edit: Here is the code I currently use
- (void)viewDidLoad {
[super viewDidLoad];
NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"loginURl"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
[webView1 scalesPageToFit];
if (theConnection) {
receivedData = [[NSMutableData data] retain];
} else {
NSLog(@"Connection Failed");
}
}
Implement NSURLConnection delegate method :
This will log to the console with connection successful string. See the response data, you may find some information about the connection in it.