richard icon indicating copy to clipboard operation
richard copied to clipboard

404 errors for API endpoints return an HTML body

Open miguelgrinberg opened this issue 11 years ago • 1 comments

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.

miguelgrinberg avatar Apr 27 '14 00:04 miguelgrinberg

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.

willkg avatar May 02 '14 16:05 willkg