JSON Error Response
Here's an example of a json error response:
Minified
{"error":true,"code":404,"message":"Not found"}
Formatted
{
"error": true,
"code": 404,
"message": "Not found"
}
JavaScript Usage
// Parse JSON
const data = JSON.parse('{"error":true,"code":404,"message":"Not found"}');
// Stringify with formatting
JSON.stringify(data, null, 2);