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

随声附和 提交于 2019-12-01 16:09:51
Berkan Ercan

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

In my case issue was in 3rd party library - FirebasePerformance. Bug report URL: https://github.com/firebase/firebase-ios-sdk/issues/486

It is late to reply but I recently face the error while running the new application assigned to me. The application is one of them whose URL Domains are blocked by the system administrator of my company.
I ask them to allow me the URL access after which the response came and the application run perfectly.
This may be not the actual solution for everyone but some of the developers may have the restricted environment can get help by this.

Well, in my case simply increasing the timeout of request solved the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!