Content negotiation; add extension to URL and match mime-type of the @Produces

4 views
Skip to first unread message

Toby Weston

unread,
Oct 10, 2014, 2:58:50 AM10/10/14
to utter...@googlegroups.com

Can someone remind me how I make

/foo.json

for a URL resolve to
  
application/json

in terms of content negotiation

and

/foo.xml


resolve to

application/xml

and so match a GET with @Produces("application/xml")

please?

Cheers

Stuart Miller

unread,
Oct 10, 2014, 8:32:29 AM10/10/14
to utter...@googlegroups.com

You need the ConvertExtensionToAcceptHeader.

--
You received this message because you are subscribed to the Google Groups "utterlyidle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to utterlyidle...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Savage

unread,
Oct 10, 2014, 8:40:38 AM10/10/14
to utterlyidle

Toby Weston

unread,
Oct 14, 2014, 2:36:22 AM10/14/14
to utter...@googlegroups.com
Thanks ;)
Reply all
Reply to author
Forward
0 new messages