用自己封装的axios发送post请求, 后台返回400. 说我参数格式错误
export const questionnaire = (payload) => {
return request(C.QUESTIONNAIRE,'post',payload,{
transformRequest: [function (data, headers) {
headers['Content-Type'] = 'application/x-www-form-urlencoded'
data = qs.stringify(data)
return data
}]
})
}
点击按钮发送请求
handleClick(index, row) {
this.idx = index
this.loading = true
(this.pidList为数组数据)
questionnaire({params: this.pidList}).then( result => {
this.loading = false
console.log(result)
})
},
后台数据格式:
holdtom
桃花长相依
相关分类