Shrinivas Kulkarni
Shrinivas Kulkarni

Reputation: 492

API failed with error Error Domain=NSURLErrorDomain Code=-1003

For our iOS application I am using AWS server and for a particular API I am always getting failed with error "API failed with error Error Domain=NSURLErrorDomain Code=-1003. A server with the specified hostname could not be found."

I am using AFNetworking for making API request.

Any hints as to where I might be going wrong? Whether its as API/Server issue or a client/iOS side issue.

Upvotes: 3

Views: 2660

Answers (2)

Dania Delbani
Dania Delbani

Reputation: 826

There is 2 main reasons:

  • a DNS related issue try to connect to another network.
  • trying wrong url

in my case my url was encoded to another in background because of copying it from other file. when I delete the url and retype it then it works.

Upvotes: 0

Mayank Patel
Mayank Patel

Reputation: 3908

This error would typically suggest a DNS related issue.. It had nothing to do with AFNetworking (except for maybe reporting the wrong error)

Upvotes: 1

Related Questions