Hi Paul,
Please see inline below...
Paul Sandoz wrote:
>
> On Jan 30, 2009, at 11:33 PM, Marc Hadley wrote:
>
>> On Jan 30, 2009, at 4:46 PM, Farrukh Najmi wrote:
>>>
>>> BTW, do you have an opinion on use of a format QueryParam vs,
>>> request header. The latter seems the more RESTFul approach but I am
>>> not sure how a human user can specify request header in a URL.
>>
>> Right. The Accept header is the HTTP way of specifying the desired
>> format but browsers don't normally give you the option of specifying
>> an accept unless you are using something like the Poster plug-in for
>> Firefox.
>>
>>> Is there a standard mechanism for encoding HTTP request header param
>>> values within a URL? If not, and if I need a human to be able to
>>> specify format in a web browser then it seems the format QueryParam
>>> is my best option.
>>>
>> There's no standard mechanism but there are some conventions. E.g.
>> Rails uses file extensions like .xml on the end of the URL.
Extension at the end of URL is not an option because we may have several
parameters at the same time to influence desired representation of
resource (e.g. format=XML | JSON, lang=en-US | fr, ...)
>> We had some support for that kind of extension-based conneg in
>> pre-1.0 JAX-RS but Roy Fielding persuaded us that it was a bad idea
>> to include this in the spec, see the following message and the rest
>> of the thread for an idea of the tradeoffs:
>>
>> https://jsr311.dev.java.net/servlets/ReadMsg?list=dev&msgNo=1458
>>
>> IIRC, Jersey still supports this functionality as an extension however.
>>
>
> It does. One currently needs to extend a ResourceConfig implementation
> and set a map of extension to media type. I am not satisfied with that
> approach and it would be better to support a filter for URI path
> extensions or a query parameter as you mention below.
>
> Farrukh, if you want this functionality could you log an issue?
>
I was able to do the following in an app specific manner without much
trouble and therefor do not have need for a new feature...
If no format parameter is specified simply use the Accept header value
to determine response format. If format is specified on URL then have it
override the Accept header value to determine response format.
Thanks to you guys for the terrific JAX-RS spec and jersey project.
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com