server's built-in NotFound handler supposedly will accept different payloads, but as used by the internal engine, it always returns ContentType.HTML with a "Not Found" body. It should be maybe a tiny bit more intelligent. (This would be a breaking change as most everybody will have overridden the NotFound handler for their apps.)
It should probably do something intelligent if the client accepts HTML or text only, but applications will need to override or add to this behavior to send JSON or XML not found messages (esp json for AngularJS). Add support for detecting very basic mime types:
- JSON - send body with "data" and "message" in error, which is pretty standard
- HTML - current behavior
- default if nothing else supported - plain text "Not Found"
server's built-in NotFound handler supposedly will accept different payloads, but as used by the internal engine, it always returns ContentType.HTML with a "Not Found" body. It should be maybe a tiny bit more intelligent. (This would be a breaking change as most everybody will have overridden the NotFound handler for their apps.)
It should probably do something intelligent if the client accepts HTML or text only, but applications will need to override or add to this behavior to send JSON or XML not found messages (esp json for AngularJS). Add support for detecting very basic mime types: