andorid启动http通信时需要做的配置
<?xml version="1.0" encoding="utf-8" ?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system"/>
</trust-anchors>
</base-config>
</network-security-config>
在res目录下新建xml文件夹然后新建文件命名为network_config.xml
然后在AndroidManifest中"application"标签中加入一个属性
android:networkSecurityConfig="@xml/network_config"
大功告成!