I switch out AFnetworking
API from ASIHTTPRequest
in my app for connection error issues.
But now I'm getting connection error in AFNetworking
. How can I resolve this?
Printing description of error: Error Domain=NSURLErrorDomain Code=-1003 "A server with the
specified hostname could not be found." UserInfo=0x1553bab0
{NSErrorFailingURLStringKey=https://example.com/oauth/token,
NSErrorFailingURLKey=https://example.com/oauth/token, NSLocalizedDescription=A server
with the specified hostname could not be found., NSUnderlyingError=0x1553b2c0 "A server
with the specified hostname could not be found."} (lldb)
Basically it's a server side issue. This error occur when your server is not responding or your server looks like in sleep mode.
I have also fetch this same issues many time. But, in my case when i switch to another WiFi network or Switch ON/OFF WiFi then it was automatically solved. Please try that and let us know your comments.
Thanks!
I know this is an old thread, but I was also running into this problem. Resetting the device fixed the issue for me. I believe it may have something to do with DNS Pollution. I didn't have the issue after resetting so I couldn't keep testing, but I have read that turning on airplane mode and turning it off again works too.