 <p>In fact, your issue is related to the content negotiation feature of HTTP (Conneg). This leverages two headers:</p> <ul> <li><code>Content-Type</code>: the format of the text payload of a request or a response. In your case, this header tells to the client the structure of the data you return.</li> <li><code>Accept</code>: the format of the text payload you expect in the response. This header is used within requests and is automatically set by the browser according to what it supports. The server is responsible of taking into account this header to return the supported content.</li> </ul> <p>See this article for more details:</p> <ul> <li>Understanding HTTP content negotiation: <a href="http://restlet.com/blog/2015/12/10/understanding-http-content-negotiation/" rel="nofollow">http://restlet.com/blog/2015/12/10/understanding-http-content-negotiation/</a></li> </ul> <p>Restlet provides out of the box content negotiation. I mean you return a text, it will automatically set the <code>Content-Type</code> header in the response to <code>text/plain</code>:</p> <pre><code>@Get public String represent(){ return "Hello World"; } </code></pre> <p>You have completely the hand if you want return another content type. Here is a sample:</p> <pre><code>@Get public Representation represent() { return new StringRepresentation( "&lt;tag&gt;Hello World&lt;/tag&gt;", MediaType.APPLICATION_XML); } </code></pre> <p>You can also define a parameter at the <code>@Get</code> level to take into account the provided <code>Accept</code> header:</p> <pre><code>@Get('xml') public Representation represent() { return new StringRepresentation( "&lt;tag&gt;Hello World&lt;/tag&gt;", MediaType.APPLICATION_XML); } @Get('json') public Representation represent() { return new StringRepresentation( "{ \"message\": \"Hello World\" }", MediaType.APPLICATION_JSON); } // By default - if nothing matches above @Get public Representation represent() { return new StringRepresentation( "Hello World", MediaType.PLAIN_TEXT); } </code></pre> <p>Another thing is that Restlet allows to leverage beans directly at the level of server resource methods instead of <code>String</code> or <code>Representation</code>. This corresponds to the converter feature. To use it, you need to register a converter. For example, simply add the jar file (org.restlet.ext.jackson with dependencies) from the Jackson extension of Restlet. A converter based of Jackson will be automatically registered. This way text payload will be converter to bean and bean to text.</p> <p>Now you will be able to use something like that:</p> <pre><code>@Get('json') public Message represent() { Message message = new Message(); message.setMessage("Hello world"); return message; } </code></pre> <p>based on a <code>Message</code> class you create:</p> <pre><code>public class Message { private String message; public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } } </code></pre>