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:
http://wiki.restlet.org/developers/172-restlet/226-restlet.html

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com



Ben R Vesco a écrit :
> 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 of the media types that were sent in that
> header. What you do with that info is pretty application specific.
> Perhaps a Filter that verifies the value in the "beforeHandle" method
> and takes some action if the values are not favorable? That would be a
> way to enforce it on every request. You could also verify it per
> resource or some other solution.
> 
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2412760
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2413026

Reply via email to