Skip to content

Accept header (without ) not recognized, falls back to JSON #105

@jmandel

Description

@jmandel

Bug

Accept: application/xml falls back to JSON. Only application/fhir+xml triggers XML output. The generic MIME type should be accepted as an alias per the FHIR spec.

Repro

curl -s -D- 'https://tx-dev.fhir.org/r4/CodeSystem/$lookup?system=http://hl7.org/fhir/administrative-gender&code=male' \
  -H 'Accept: application/xml' 2>&1 | grep -i content-type
# Returns: application/json; charset=utf-8
# Expected: XML response

Spec reference

R4 section 2.21.0.6: "FHIR resources can also be exchanged with application/json and application/xml."

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiThe issue relates to the API / http functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions