Re: Enforcing HTTP accept header

2009-10-30 Thread Jerome Louvel
Hi all, In addition to Ben's excellent reply, I would point that ServerResource subclasses can enforce the media types they accept using annotation parameters, such as: @Put(xml) public void store(Document doc){ ... } More details in the Javadocs or here:

Re: Enforcing HTTP accept header

2009-10-30 Thread Fabian Mandelbaum
I guess the correct syntax would be: @Put(xml) public void store(Document doc) { ... } Same goes for @Get annotation. You can get a list of supported out-of-the-box extensions here http://www.restlet.org/documentation/2.0/jse/api/org/restlet/service/MetadataService.html#addCommonExtensions()

Re: Enforcing HTTP accept header

2009-10-29 Thread Ben R Vesco
As in, enforce a particular value in it? Check here: http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/130-restlet.html which shows us we can get the value from the header by querying the ClientInfo object like this: request.getClientInfo().getAcceptedMediaTypes() Which will return a list