HTTP状态码0-错误域= NSURLErrorDomain? [英] HTTP status code 0 - Error Domain=NSURLErrorDomain?

查看:428
本文介绍了HTTP状态码0-错误域= NSURLErrorDomain?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个iOS项目.

I am working on an iOS project.

在此应用程序中,我正在从服务器下载图像.

In this application, I am downloading images from the server.

问题:

在下载图像时,我得到请求超时.根据文档,请求超时的HTTP状态代码为408.

While downloading images I am getting Request Timeout. According to documentation HTTP status code of request timeout is 408.

但是在我的应用程序中,我收到HTTP状态代码0并显示以下错误

But in my application, I am getting HTTP status code 0 with the following error

Error Domain = NSURLErrorDomain代码= -1001请求超时." UserInfo = 0xb9af710 {NSErrorFailingURLStringKey = http://xxxx.com/resources/p/PNG/1383906967_5621_63.jpg , NSErrorFailingURLKey = http://xxxx.com/resources/p/PNG/1383906967_5621_63.jpg, NSLocalizedDescription =请求超时. NSUnderlyingError = 0xx13846870请求超时."}

Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0xb9af710 {NSErrorFailingURLStringKey=http://xxxx.com/resources/p/PNG/1383906967_5621_63.jpg, NSErrorFailingURLKey=http://xxxx.com/resources/p/PNG/1383906967_5621_63.jpg, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x13846870 "The request timed out."}

在搜索过程中,通过互联网,我没有找到有关HTTP状态码0的信息.

During a search, over internet, I found no information about HTTP Status Code 0.

有人可以向我解释吗?

推荐答案

没有HTTP状态代码0.您看到的是所使用的API/库返回的0.您将需要检查文档.

There is no HTTP status code 0. What you see is a 0 returned by the API/library that you are using. You will have to check the documentation for that.

这篇关于HTTP状态码0-错误域= NSURLErrorDomain?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆