FHIR Chat · MIME types · implementers

Stream: implementers

Topic: MIME types


view this post on Zulip Dion McMurtrie (Dec 15 2015 at 02:29):

I've read the FHIR spec section 2.1.0.6 a few times now which seems to be saying that a client can request non-FHIR specific MIME types (like "application/xml") but the server will always respond with one of the FHIR MIME types application/json+fhir or application/xml+fhir. That's the behaviour I've observed from servers anyway.

This does create an issue accessing these resources from JavaScript in a browser (browser gets between the request and response). Since xxx/xxx+fhir is an unknown MIME type, most browsers will also require the allow CORS header. This would not be the case if the MIME type were application/json or application/xml, but the “+fhir” bit means the browser is overly skeptical about whether to allow it.

If a client could request _format=application/xml and get a response content type of application/xml (without +fhir) there would be a work around, but it seems the spec says the server must return application/xml+fhir.

Has anyone else run into this? Seems a pain to have to require the allow CORS header just for this.

view this post on Zulip Grahame Grieve (Dec 20 2015 at 08:39):

Dont you require CORS headers anyway?


Last updated: Apr 12 2022 at 19:14 UTC