Question: #FHIR _format parameter

Feb 2, 2016

Question:

The FHIR specificationsays:

Servers SHOULD support the optional _format parameter to specify alternative response formats by their MIME-types. This parameter allows a client to override the accept header value when it is unable to set it correctly due to internal limitations.

If both _format and accept headers are present with valid but different values, which of them should take the precedence?

Answer:

_format is definitely an override, and always takes precedence if it’s present. It’s explicitly provided for where the user doesn’t have access to the Accept: header, but needs to specify what type to return. Typically, this is a user using a browser manually, or an XSLT web call, though I’ve heard of a few other cases.