A method with an @Post annotation is not required to receive an argument, unless you intend to receive a payload from your request.

If you want to filter on the media type of the incoming representation, use the "json" shortcut, as follow

@Post("json")

This will prevent you to test the media type of the representation.

The list of all available shortcut is available here. Most of them are quite simple to remember. The main reason to use shortcuts (or "extension" such as file extension) is that "xml" is related to several media types (application/xml, text/xml).

If you want to get the full content of the representation, simply call the "getText()" method, instead of using the getReader() and consume it.

If you want to support CORS, I suggest you to use the CorsService (available in the 2.3 version of the Restlet Framework.

Notice there exists a shortcut for getting the headers from a Request or a Response, just call the "getHeaders()" method.

Notice there exists a shortcut for getting the attributes taken from the URL, just call the "getAttribute(String) method.

Here is an updated version of your source code:

public class TestApplication extends Application {