小程序接口请求成功,得不到请求数据

小程序接口请求成功但是请求不到数据,解决办法:在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使用
      },