小程序接口请求成功但是请求不到数据,解决办法:在wx.request({})的header中添加

'content-type': 'application/x-www-form-urlencoded',

主要代码如下:

 header: {
        'content-type': 'application/x-www-form-urlencoded',//解决请求不到数据
        'cookie': wx.getStorageSync("sessionid")//读取sessionid,当作cookie传入后台将PHPSESSID做session_id使用
      },

  

相关文章:

  • 2022-01-05
  • 2022-02-04
  • 2021-07-16
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-20
  • 2022-12-23
  • 2022-02-19
  • 2021-08-05
  • 2022-01-17
  • 2021-11-15
  • 2022-01-11
相关资源
相似解决方案