升级为iOS9后,默认请求类型为https,如何使用http进行请求会报错

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

方案一:让服务器修改为TLS1.2

 

方案二:在plist中设置使用http请求

第一步:在plist中添加NSAppTransportSecurity项,此项为NSDictionary

第二步:在NSAppTransportSecurity下添加

NSAllowsArbitraryLoads类型为Boolean,value为YES

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-09-26
猜你喜欢
  • 2021-09-30
  • 2022-12-23
  • 2021-09-06
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
相关资源
相似解决方案