Xcode:访问http网络失败

2016-08-09  本文已影响38人  valentizx

在网络请求(http)时,控制台报如下错误信息

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

新特性要求app访问的网络必须使用https协议。


解决办法

  1. info.plist中添加App Transport Security Settings(类型是字典)。
  2. App Transport Security Settings下添加Allow Arbitrary Loads(类型为Boolean)设置值为YES
朵蜜网络吧~
上一篇 下一篇

猜你喜欢

热点阅读