wx.request的POST方法的参数传输服务器接收不到的bu

2021-03-02  本文已影响0人  莫伊剑客

wx.request post 的 content-type 默认为 'application/json'
如果服务器没有用到 json 解释的话,可以把 content-type 设置回 urlencoded。


   wx.request({

     ....

     method: "POST",

     header: {

       "content-type": "application/x-www-form-urlencoded"

     },

     ...

   })

终于可以post提交了,大家不要按照官网的文档写,也不用转格式,修改header即可。

上一篇 下一篇

猜你喜欢

热点阅读