Publish Data to server failed Error: Request failed with status code 500 at createError code example
Example: POST http://localhost:5001/api/v1/identity/login 500 (Internal Server Error) LoginForm.jsx:30 Error: Request failed with status code 500 at createError (createError.js:16) at settle (settle.js:17) at XMLHttpRequest.handleLoad (xhr.js:61) react
axios.post(
config.apiGateway.URL + ".../signin",
payload
).then(response => {
console.log(response)
if(response.status == 200){
console.log("Login successfull");
this.setState({token: response.data.JWT_TOKEN});
} else {
console.log(response.status)
this.setError()
}
}).catch(error => {
this.setError()
console.log(error)
if (error.response) {
console.log("--------------------------------------------------")
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.request) {
console.log("*************************")
console.log(error.request);
} else {
console.log("++++++++++++++++++++++++")
console.log('Error', error.message);
}
console.log(error.config);
})