如何使用Axios将表单数据数组发布到javascript脚本

时间:2019-05-09 03:24:27

标签: axios form-data

如何使用Axios将表单数据数组发布到javascript脚本?

1)设置内容类型:“ application / x-www-form-urlencoded” 2)使用新的Formdata(),将arr附加到formdata中

data: data,
headers: {
  'Content-Type': 'application/x-www-form-urlencoded'
},
transformRequest: [toFormData]

    {page_num: this.currentPage,
    page_size: this.pageSize,
    deposit: ['100', '200']
}

服务器应使用数组格式正确答复

0 个答案:

没有答案