API 文档说明 NSURLConnection::initWithRequest 请求传递了 url 参数。在服务器上没有收到任何东西,但是参数是有效的,并且可以在同一台机器上的浏览器中工作。烂苹果里到底发生了什么?
NSString* urlString = <valid url working from browser>;
NSURLRequest* request = [[NSURLRequest alloc] initWithURL: [NSURL URLWithString:urlString] cachePolicy: NSURLRequestReloadIgnoringLocalCacheData timeoutInterval: 10];
NSURLConnection* connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
<Connection validated here>
<Delegate methods implemented elsewhere>