richard
richard copied to clipboard
404 errors for API endpoints return an HTML body
The errors should honor the Accept-Encoding header sent by the client, at least JSON should be supported in addition to HTML for API clients.
The issue here is that the things requested were not api endpoints. So django does its normal 404 thing which returns an html page.
The fix here is to modify that behavior so that if the client asks for json, it gets a json 404 rather than an html 404.
Marking this bite-sized. It probably involves poking the django docs to see how to adjust 404 handling in this way.