dev@jsr311.java.net

RE: Content Negotation vs. Extensions

From: Jerome Louvel <jerome.louvel_at_noelios.com>
Date: Thu, 26 Apr 2007 17:00:13 +0200

Hi Stefan,

As serving files from directories on the file systems is not really in our
scope, I think that when users need to specify a special media type that
they want to get, they have two options:

1) Adjust their "Accept" header to force the conneg to return a specific
representation
2) Rely on a query parameter like "media=application/xml"

Note that the ".xml" extension is more ambiguous than "application/xml" or
"application/blinksale-xml".

We could even automate the translation of the "media" parameter into an
"Accept:" header like we do in the Restlet framework:
http://www.restlet.org/documentation/1.0/api/org/restlet/service/TunnelServi
ce.html

Best regards,
Jerome

> -----Message d'origine-----
> De : Stefan Tilkov [mailto:stefan.tilkov_at_innoq.com]
> Envoyé : jeudi 26 avril 2007 12:12
> À : dev_at_jsr311.dev.java.net
> Objet : Content Negotation vs. Extensions
>
> I know the "right" way to do return different representations of a
> resource is via content negotiation. Still, in many cases it's
> perceived to be easier to use different extensions for
> different types.
>
> E.g. I could do a GET on http://example.org/customers/4711 to
> get the
> default representation, say in HTML, and use http://example.org/
> customers/4711.xml to get an XML representation. Whether this is
> "good" or "bad" doesn't really matter IMO; it's going to
> definitely a
> common approach. How do we address this?
>
> Stefan
> --
> Stefan Tilkov, http://www.innoq.com/blog/st/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>