OPTIONS http://test.test:3000/profiles net :: ERR_EMPTY_RESPONSE
是我得到的回应。我应该传递令牌和用户ID,但我确实传递了标头。我不知道它在哪里我错了。而且我已经通过邮递员尝试过了,效果很好。这是我的axios发布请求的样子
axios({
method: "post",
url: url,
data: data,
mode: 'no-cors',
headers: {
"token": userToken,
"uuid": userId,
"Content-Type": "text/plain;charset=utf-8;application/json",
"Accept": "application/json",
}
})
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error);
});