In case anyone else gets to this page, you can also solve this problem by using the IP address in the URL instead of the domain:
NSURL *myURL = [NSURL URLWithString:@"http://10.0.0.2/mypage.php"];
Then you specify Host manually:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:myURL]; [request setAllHTTPHeaderFields:[NSDictionary dictionaryWithObjectAndKeys:@"myserver",@"Host"]];
As for the server, it will behave exactly as if you were using http://myserver/mypage.php , except that the iPhone will not have to do a DNS lookup.
100% open API.
ekscrypto Dec 12 '11 at 19:14 2011-12-12 19:14
source share