Axios POST request fails with error status code 500: Internal Server error

Feb 2021. Wasted 2 hours on this. Not much help on this famous library on internet. Solution: In the catch block, the error which will always be 500 internal server error so, use error.response.data instead of error. Code: try { let result = await axios.post( // any call like get “http://localhost:3001/user”, // your URL { … Read more