小程序接口請求成功但是請求不到數據,解決辦法:在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使用 },