request 开发工具上通过,手机上不行,求解

发布于 7 年前作者 wei8716298 次浏览最后编辑 7 年前来自 ask

var that = this;

console.log(‘start request’);

wx.request({

url: https://pv.sohu.com/cityjson,

header:{

‘content-type’: ‘json’

},

success: function(res) {

console.log(res);

},

以上代码电脑上出结果,手机上不行

小程序允许域名已设置,手机调试模式也试了

5 回复
jing21
jing211 楼6 年前

真机调试不能勾选那个

qiufang
qiufang2 楼6 年前

非常感谢!!!问题已解决!

现在的小程序满满都是坑啊。

yanyu
yanyu3 楼6 年前

‘content-type’

'

application/json

'

不是‘content-type’‘json’

guiyingren
guiyingren4 楼6 年前

楼主怎么解决的,我的也是模拟器数据没问题,真机请求不到数据

duanchao
duanchao5 楼5 年前

这个有没有勾选