鸿蒙OS,网络连接模式默认https,如何改成http请求模式
2021-06-08 本文已影响0人
迷失在你de流年
HarmonyOS的网络与连接访问模式默认是:https,如果你是http开头的,请在config.json文件中,找到 deviceConfig节点,添加如下配置:

具体位置:

具体代码:
"deviceConfig": {
"network": {
"cleartextTraffic": "true",
"securityConfig": {
"domainSettings": {
"cleartextPermitted": "true",
"domains": [
{
"subdomains": "true",
"name": "guolin.tech"
}
]
}
}
}
}