My url, headers and body data are defined as:
var headers = {
'Authorization': 'Bearer 12345',
'Content-Type': 'application/x-www-form-urlencoded'
}
var data = {
'password': '123456',
'ver': '1',
'time': '1534494857045'
}
I am calling axios
by:
axios.post(url, data, headers)
.then(response => {
console.log(response);
})
.catch(error => {
if (error.response) {
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.request) {
console.log(error.request);
} else {
console.log('Error', error.message);
}
console.log(error.config);
});
I am getting a 500
error from the server. Other apps calling the same server works fine. I even tried this out in Postman and it works. What am I doing wrong in axios
?