users@jsr311.java.net

Re: Variants

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 10 Mar 2008 12:55:59 -0400

On Mar 10, 2008, at 12:26 PM, Sergey Beryozkin wrote:
>
> I'd like to ask a question about variants.
>
> Specifically, ResponseBuilder has this method :
>
> variants(List<Variant> variants);
>
> Can someone please explain how a response will look like on the wire
> as a result ?
>
> I've seen that 406 code is used and that Vary header is added, but
> it's not clear how this Vary header should
> look like in the presense of multiple Variants. Perhaps this
> question is off-topic as it's more a HTTP specific question...
>
IIRC, the Vary header lists the headers that determine the response
format. So if variants contained a list with several different media
types then the vary header would list Accept as one of the headers
that whose value can be varied to get a different response.

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.