users@jersey.java.net

Re: Alternate to HttpRequestContext#getAcceptableMediaType

From: John Lister <john.lister_at_kickstone.com>
Date: Fri, 22 Oct 2010 16:18:08 +0100

On Thu, 14 Oct 2010 @ 19:25:04, Imran M Yousuf<imyousuf_at_smartitengineering.com> wrote
> I have requirement for which I will need to use a functionality such
> as HttpRequestContext.getAcceptableMediaType; but I see that it has
> been deprecated (SVN Commit #3121), could find the reason of
> deprecation in Issue 382 or release note. Is it safe to use it? What
> is the right API use for same purpose?

I would imagine that the alternative is to use request.selectVariants().

I'm not sure why it was deprecated, but I'd guess it was because selectVariants handles
the quality value as well as any language specified for the type.

Also speaking of selectVariants, it mentions in the docs that a vary header is computed and added to the response,
although it doesn't seem to do this, from evidence or the source?

John