0

I have to load all the required details from server in my application. eg; I wants to load countries detail from the following URL.

https://sub.domain.com//members/phone/XML_list_countries.php

But I am getting following error. But the same request working in Simulator.

ERROR
Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x3b8d10 {NSErrorFailingURLStringKey=https://secure.nymgo.com//members/softphone/XML_list_countries.php, NSErrorFailingURLKey=https://secure.nymgo.com//members/softphone/XML_list_countries.php, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x3b5090 "The request timed out."}

CODE

NSURL *url=[NSURL URLWithString:@"https://secure.nymgo.com//members/softphone/XML_list_countries.php"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"GET"];
NSURLConnection *_connection = [[NSURLConnection alloc] initWithRequest:_request delegate:self];
if(!_connection){
    NSLog(@"Can not make this request.");
}

I have implemented all the required delegate methods.

NOTE: My device is working in Wifi with proxy settings.

I don't know what is going wrong. Please help me to resolve this issue.

jfalexvijay
  • 3,681
  • 7
  • 42
  • 68

2 Answers2

0

Have you Implement :

- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;

Also Refer this SO post.

You can use the ASIHTTPRequest framework also.

Community
  • 1
  • 1
Maulik
  • 19,348
  • 14
  • 82
  • 137
0

I have tested the same code in different iPhone 3G and iPhone 4 devices. it is working fine.

NOTE: I searched lot in google. I got lot of result. One of the result is like "some iPhone 3G is not supporting for HTTPS. So I decided to test it in different devices.

jfalexvijay
  • 3,681
  • 7
  • 42
  • 68