wx.request({
url: 'http://192.168.0.103:8080/cg/'+p.url,
data: p.data,
contentType: "application/x-www-form-urlencoded",
header: {
'content-type': 'application/x-www-form-urlencoded;charset=utf-8' // 默认值
},
success(res) {
console.log("返回:"+JSON.stringify(res))
callback(res);
}
})
返回结果中带有中文,显示????。后台response.getCharacterEncoding() 是utf-8,
打印返回res
{"data":"????","header":{"Content-Type":"text/plain;charset=ISO-8859-1","Content-Length":"4","Date":"Fri, 21 May 2021 05:35:52 GMT"},"statusCode":200,"cookies":[],"errMsg":"request:ok"}
求大神给出解决方法。