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()

Enforcing HTTP accept header

2009-10-29 Thread legege
Hi, Is there a way to enforce the HTTP Accept header? Thanks -- View this message in context: http://n2.nabble.com/Enforcing-HTTP-accept-header-tp3914375p3914375.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http

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