POST取数据问题
wx.request({
url: ‘user/thirdparty/login’, //仅为示例,并非真实的接口地址
method: ‘POST’,
data: {
‘openid’: ‘1’,
‘thirdPartyType’: ‘1’
},
header: {
‘content-type’: ‘application/x-www-form-urlencoded’
},
success: function (res) {
console.log(res.data)
that.setData({
//array: res.data.data
})
}
})
{success: false, code: “FAILURE”, message: “Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported”, data: null}
一直取不到数据,请教怎么才能POST取到数据