uni.request({
url: _this.facilityUrl + 'useridtocid',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: motInfo,
// data: motInfo,
success: (res) => {
}
上面的代码可以正常连接后端java代码,并返回true。但是一开始我少了 header,死活返回false。前端加了header,就返回了true了。用postman测试,headers里也没有要设置content-type。我别的前端代码,有的有header,有的没有。问题是后端如何写的,才要header?怎么样写,才不要header?
--
FROM 120.242.252.*