我必須從我的應用程序中的服務器加載所有必需的詳細信息。例如;我想從下面的URL加載國家詳細信息。HTTPS請求無法在iPhone設備上工作
https://sub.domain.com//members/phone/XML_list_countries.php
但我得到下面的錯誤。但是同樣的請求在模擬器中工作。
錯誤
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.");
}
我已經實現了所有必需的delegate
方法。
注意:我的設備使用代理設置在Wifi中工作。
我不知道發生了什麼問題。請幫我解決這個問題。
我檢查了HTTP請求,它在設備上工作正常,但HTTPS不工作。 – jfalexvijay