POST请求失败,但是GET请求好使,请问怎么解决
onLoad: function () {
var that = this
wx.request({
url: 'https://www.xxxx.com/1234.php',
data:{
wz:'12589'
},
method:'POST',
headers: {
'content-type': 'application/json'
},
success: function (res) {
that.setData({
})
}
})
后来在网上查到
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
修改后依然不好使
哎,愁人啊
兄弟,你的解决了啊,我的什么都试过了,还是搞不定,服务器接受不到参数
是header
https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=0000026e8404a0176666834c55b000
你和这个题主一起讨论一下吧
post请求headers要换这个'content-type': 'application/x-www-form-urlencoded'替换后依然不好使啊
post请求headers要换这个'content-type': 'application/x-www-form-urlencoded'