Open runemadsen opened 10 years ago
Sounds good, I would follow you approach of using 'special' files like 404.json
for this. Wondering if there is a way to support multiple formats like xml, html, and json. Probably the best is going for a detection via the Accept header and if this fails try to match a content type from the request URL since there are enough cases where setting the content type is done via adding .json to the URL (looking at you rails ;) ).
They fallback should be HTML still I think. So maybe we can even include something helpful by default then if not overwritten by the user.
Most API's have a default error message like this:
It would be awesome if we could create a
404.json
or something, and have a default error response from canned. Any thoughts on name and other functionality? I might take a stab at this soon.