Hi all,

I agree that would should support both approaches. 

Actually, there is already the TunnelService that allows you, among other
things, to override the "Accept" header by using a query parameter
(/myResource?media=html). The Directory class also allows the specification
of the mediatype by appending the right 'file' extension.

We could add a feature to this service that would transparently adjust the
preferences of browsers like IE based on the user agent name. The advantage
is that it would be easier to use and wouldn't "pollute" your application
with client-specific concerns. I think that this is more the responsibility
of the component/container.

I have entered a RFE to keep track of this discussion and attached Stefan's
proposed filter:

"Adjust browser preferences for HTML/XML"
http://restlet.tigris.org/issues/show_bug.cgi?id=455

Best regards,
Jerome  

> -----Message d'origine-----
> De : John D. Mitchell [mailto:[EMAIL PROTECTED] 
> Envoyé : mardi 4 mars 2008 04:29
> À : [email protected]
> Objet : Re: HTML with REST
> 
> On Mon, Mar 3, 2008 at 6:00 PM, keke <[EMAIL PROTECTED]> wrote:
> [...]
> > > Another workable solution I have found -- if you are 
> using XML and will get
> >  > criticized for making up MIME types -- is to expose the 
> browser-friendly
> >  > HTML variant by itself on a distinct URI (e.g. 
> person.html).  That's sloppy
> >  > too, just in a different way.
> >
> >  I think this might be a better and clear way than 
> specifying content
> >  type in the HTTP header. The book Restful web service also 
> recommends
> >  doing this. It is both friendly to browser client and programmatic
> >  client.
> 
> It's easy enough to support both approaches in the Resources' code.
> I.e., it doesn't have to be an either/or dichotomy.
> 
> Take care,
> John

Reply via email to