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:
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()
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
3 matches
Mail list logo