查看一下服务器接收的post 参数是以什么形式接收的
微信给出得demo 请求的方式是Json 参数传递的
所以如果服务器使用的from 表单形式接收数据需要更改微信小程序中的 header
将
header: {
'content-type': 'application/json'
},
改成
header: {
'content-type': 'application/x-www-form-urlencoded'
},
查看一下服务器接收的post 参数是以什么形式接收的
微信给出得demo 请求的方式是Json 参数传递的
所以如果服务器使用的from 表单形式接收数据需要更改微信小程序中的 header
将
header: {
'content-type': 'application/json'
},
改成
header: {
'content-type': 'application/x-www-form-urlencoded'
},