微信小程序: POST请求参数传递的问题,后台接收不到“behavior_result”参数

新手上路,请多包涵

如图:图片描述

这个是我的代码:

wx.request({

  url: 'https://api.scy.xieshou.org/',
  data: {
    method: 'Evaluation.submitBehaviorReport',
    v: '2',
    selected_filter:[
      {
        filterid: this.data.filter_id,
        filtername: this.data.filter_name
      }
    ],
    send_info:{
      gender: this.data.userData.gender,
      beh_time: this.data.userData.beh_time,
      age: this.data.userData.index,
      from_url:'',
      pid:'',
      cid:'',
      rid:''
    },
    behavior_result: [optionArr]
  },
  method: 'POST',
  header: {
    "content-type": "application/x-www-form-urlencoded"
  },
  success: function(res){
    console.log(res)
    _this.setData({
      report_id: res.data.data.report_id
    })
  }
})


阅读 3.9k
1 个回答

你看看后台接受的格式是不是json格式的,因为你现在传过去的是"content-type": "application/x-www-form-urlencoded"

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题