users@jsr311.java.net

Re: When to sort Accept header values

From: Sergey Beryozkin <sberyoz_at_progress.com>
Date: Wed, 4 Feb 2009 16:17:31 -0000

Hi Reto


> Hi Sergey
>
> Afaict the behaviour you describe is Jersey specific.

It does seem so
>
> For clients there is a way to express the priority of accept-headers, by
> expressing the q-value. What would the advantage be of specifying the
> order as being relevant?

> A client that expects the order to be relevant is bogus in terms of HTTP-compliance
What does this compliance guarantee to a client ? If a client sends

Accept : application/xml,application/json;q=0.7

then can the client be guaranteed XML will flow back ?

At least with :

Accept : application/xml,application/json;
Accept : application/json,application/xml;

it works with Jersey now.

It just seems counter-intuitive to do :

Accept : application/json,application/xml;q=0.8

If a client has already put application/xml in the end.

As I said clients are writing their applications against targeted applications. It's the browsers which create those uber-complex
accept values. As far as ordinary clients are concerned, I'm not certain they will fare better with
application/json,application/xml;q=0.8 when sending requests to some dynamic resources they didn't hear before about than with
application/json,application/xml.

Cheers, Sergey

>
> Reto
>