热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ios11中任务的HTTP加载失败(错误代码:-999[1:89])-HTTPloadfailed(errorcode:-999[1:89])forTaskiniOS11

ImusingURLSessiontoperformadatatask,whenIrunitoniOS11,Igetaconsoleerror:我使用URLSe

I'm using URLSession to perform a datatask, when I run it on iOS 11, I get a console error:

我使用URLSession来执行datatask,当我在ios11上运行时,我得到一个控制台错误:

HTTP load failed (error code: -999 [1:89]) for Task <68809C58-C6A7-4F10-86A4-81396D8B18CF>.<2>  

Any thought on what's causing it, or how to fix it?

有没有想过是什么引起的,或者怎么修复?

2 个解决方案

#1


4  

HTTP load failed (error code: -999 [1:89]) for Task

Error -999 means NSURLErrorCancelled, your request has been canceled before completion. According to the apple developer blog, there are few changes with ATS (likely that your server is using one of legacy crypto facilities that have been removed in iOS 11.) So give a try and implement the connection:didReceiveAuthenticationChallenge: and see if your server raises authentication challenge if yes then here is something we need to handle.

错误-999表示nsurlerrorcancel取消,您的请求在完成之前已被取消。根据苹果开发者博客,ATS没有什么变化(很可能你的服务器使用的是ios11中删除的遗留密码设备之一)。因此,请尝试并实现连接:didReceiveAuthenticationChallenge:并查看如果您的服务器提出了身份验证挑战,如果是,那么这里有一些我们需要处理的东西。

I hope it will help!

我希望它能有所帮助!

#2


-1  

I had the same error HTTP load failed (error code: -999 [1:89]) just on iPhone7, not the simulators. I fixed this error by reseting the network settings on the phone.

我有相同的错误HTTP负载失败(错误代码:-999[1:89])只是在iPhone7上,而不是模拟器。我通过重新设置电话上的网络设置修正了这个错误。

Settings > General > Reset > Reset Network Settings.

设置>一般>复位>复位网络设置。


推荐阅读
author-avatar
发哥争霸
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有