wx.request的入参是不是不能是json对象
var student = new Object(); student.name = "Lanny"; student.age = "25"; student.location = "China"; wx.request({ // 调用接口 url: 'http://localhost:8080/visisys1/abc/addCode', method: 'GET', data: { data: "abc", otherinfo: student }, success(resp) { console.log("res******************", resp.data); } }) |
当入参的data:{otherInfo: student},如果otherInfo是json对象时,后台入参也是json格式的,但是会报argument type mismatch的错误。
后台代码:
报错信息:
