Создание вызова Axios с заголовками
axios.post('url', {"body":data}, {
headers: {
'Content-Type': 'application/json'
}
}
)
Salo Hopeless
axios.post('url', {"body":data}, {
headers: {
'Content-Type': 'application/json'
}
}
)
var postData = {
email: "test@test.com",
password: "password"
};
let axiosConfig = {
headers: {
'Content-Type': 'application/json;charset=UTF-8',
"Access-Control-Allow-Origin": "*",
}
};
axios.post('http://<host>:<port>/<path>', postData, axiosConfig)
.then((res) => {
console.log("RESPONSE RECEIVED: ", res);
})
.catch((err) => {
console.log("AXIOS ERROR: ", err);
})