I'm considering the design of a ReST service where resources can be served with multiple representations.
My preferred method of doing this is for client to make a request with appropriate Accept header, and for the response to be made with a Vary header set on Accept:
Vary: Accept
My question is, will this be respected by various hardware (proxy layers etc.) out there on the internet, or do I risk some piece of hardware serving one of my clients a pdf representation of my resource when they asked for some kind of xml representation?
My alternative would be to run conneg through a uri extension
~/resource.pdf || ~/resource.xml)
or more likely through a querystring parameter:
~/resource?content-type=application/pdf || ~/resource?content-type=application/vnd.mytype+xml
So: Am I gonna be alright with Vary:Accept, or do I need to play it safe by messing with my Url? Which pieces of hardware will cause me problems? Is there anything else I should be considering?
Thanks