Error: Error Domain=Nsurlerrordomain Code=-1001 "The Request Timed Out."

Error: Error Domain=NSURLErrorDomain Code=-1001 The request timed out.

There was no issue in the code. I guess the simulator internally was not able to connect to the internet, so that is why it was not able to connect to the server after providing various timeout intervals. But it worked completely fine when I executed another day. Thanks to @Andrew Jaffee for helping me to find this issue.

I get Error Domain=NSURLErrorDomain Code=-1001 The request timed out. on iOS devices but works fine on android

The solution was to not send body with a GET request.
I knew it did not follow the request pattern for GET. Thought it was possible.

It was bad project planning on my part. One of my first own projects as a developer. All identifying information that is not secret should be kept inside the token. So when sending get requests the header with token has all the information needed to filter what data is sent back to the user.

Good luck and hope it helps!

NSURLErrorDomain code =-1001 request getting timed out

From the documentation:

Timeout

You can set a custom timeout value (in seconds):

[UNIRest timeout:2];

By default the timeout is 60.

NSURLErrorDomain Code=-1001 error when a http post request is sent

Apparently my post request was getting a timeout error since I was sending an image that the server would find too large. I scaled down the images in order to make my images acceptable by the server.

As this post suggests, NSURLErrorDomain Code=-1001 error might be caused by many things including;

  • Server response time limit
  • Server rules about the incoming data
  • Authentication problems

Hope that helps to other people



Related Topics



Leave a reply



Submit