/[STATUS]?json=[JSON_RESPONSE]
/200
Response: (Status: 200)
{}
/500?json={"error":"Custom message"}
Response: (Status: 500)
{
"error": "Custom message"
}
axios.get('/500?json={"error":"Custom message"}')
.catch(function (error) {
console.log(error.response.status); // 500
console.log(error.response.data); // {"error":"Custom message"}')
});