我正在尝试使用Javascript中的Axios库发出发布请求,如下所示:
axios.post('/businesses', fd,
{
headers: {
'content-type': 'multipart/form-data'
}
})
.then(response => {
console.log(response);
this.completeButton = 'Completed';
})
.catch(error => {
console.log(error)
this.completeButton = 'Failed';
})
如果我在服务器端输出全局$ _FILES变量,我什么也没得到。
这是控制台中的响应头。我不知道为什么内容类型没有更改。