I get this error when I try running the app on a device. I do not get this error when I run it on the simulator and the post request works fine. This is code snippet I have:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:300.f];
[request setHTTPMethod:@"POST"];
NSData* data = [paramString dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:data];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection start];
Any help is appreciated. Thanks
Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found
Several users have complained about getting the “A server with the specified hostname could not be found” error in Mac. This error is just one of the many bugs that have been plaguing the newly released macOS Big Sur. What is the Cannot install from App Store.
The host name in your URL is wrong because the message you are getting back explicitly states it can't find a server with that host name. The mst likely cause is that you have forgotten to put a forward slash between the base URL and the email e.g. if your base URL is
iOS Error Code=-1003 "A server with the specified hostname could not be found." Ask Question Asked4 years, 9 months ago Active1 year, 2 months ago Viewed34k times 30 4 I am trying to load image from URL on the iphone, image is there and I can open it in safari with same link, but not in the app:
With Xcode 11.2.1, working on a macOS project, I had the same issue.
The fix here was:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With