Fazendo o Axios ligar com cabeçalhos
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: "[email protected]",
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);
})