I\'m using Restlet 2.1 with jackson to build a json REST api.
When I make a request with the expected content type but a malformed body, I get back a 415 \"Unsuppore
415 is correct, as the request is NOT in the right format if it is corrupted in anyway. For example non-parseable JSON or XML. Malformed JSON or XML is NOT JSON or XML by definition, and thus is an unsupported media type, there is no way for Jackson to know that is is supposed to be JSON, it just knows that it isn't JSON that it can parse.
The offical documentation is really clear about this.
10.4.16 415 Unsupported Media Type
The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
you said, hey this is JSON, and it isn't so the server says, hey, what I got isn't JSON and not supported by this resource.