Hi Mark,
On Mar 11, 2009, at 11:53 PM, Mark Derricutt wrote:
> 'lo all,
>
> I was wondering how content negotiation works (or is supposed to work)
> with restlet?
>
> I have a resource mounted at "/report" that has the various variants
> set in its constructor:
>
> setVariants(Arrays.asList(
> new Variant(MediaType.APPLICATION_JSON),
> new Variant(MediaType.APPLICATION_PDF)
> ));
>
> If I request /report/test my resource is picked up and
> represent(variant) is called with a media type of application/json,
> however if I request /report/test.pdf - application/json is still
> used. Is there something I need to do in order for my resource to be
> called with an application/pdf media type? Is it because my mount is
> only /report and I'm working on the assumption my request is being
> matched? Would it work if I mounted against /report/${reportId}?
By default, Restlet only does content negotiation via the Accept
header (per the HTTP spec). If you want to do extension-based
negotation, you need to enable it in your Application's TunnelService.
Rhett
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1311104