I am sending a synchronous request and getting a error
NSData *aResponseData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&aResponse error:&anError];
Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x6ede3d0
What could be the reason for this? What is the default timeout for NSURLConnection? Can I print this value?
Have you checked to make sure you’re able to connect to the URL in a browser or using a tool of some sort (e.g. curl or wget)? How about from Safari on the device (or simulator) you’re testing on just to make sure it’s not a network issue of some sort?
You can specify a timeout value by creating your NSURLConnection using the requestWithURL:cachePolicy:timeoutInterval: class method.