Hi John,

Good point! I've added this paragraph in the getVariants() method:

* Note that the order in which the variants are inserted in the list
* matters. For example, if the client has no preference defined, or if the
* acceptable variants have the same quality level for the client, the first
* acceptable variant in the list will be returned.<br>

Best regards,
Jerome  

> -----Message d'origine-----
> De : John D. Mitchell [mailto:[EMAIL PROTECTED] 
> Envoyé : mercredi 1 août 2007 18:16
> À : [email protected]
> Objet : Variant ordering -> preference
> 
> I think it would be helpful if the documentation for the getVariants()
> and getRepresentation() methods would make it clear that the order in
> which the variants are in the variants list specifies the preferred
> variant (all else being equal).
> 
> I.e., if I add TEXT_PLAIN and then TEXT_HTML then TEXT_PLAIN will be
> selected as the preferred variant regardless of the ordering of the
> fields in the Accept: header (but it does basically respect the q
> values).
> 
> The spec seems to be ambiguous on the ordering issue but it's common
> practice to put the preferred types in descending order.
> 
> Thoughts?
> 
> Thanks,
> John

Reply via email to