nhsconnect / nrls-reference-implementation

Reference Implementation of NRLS providers and consumers
Apache License 2.0
1 stars 2 forks source link

HAPI FHIR Client defaults _format=xml which gives 415 unsupported media type #4

Closed KevinMayfield closed 5 years ago

KevinMayfield commented 6 years ago

HAPI seems to default to the older _format method of specifying content type.

This results in NRLS returning 415 error (as per https://developer.nhs.uk/apis/nrls/development_general_api_guidance.html)

Logged on HAPI forum https://groups.google.com/forum/#!topic/hapi-fhir/GvmJ_2dqyVM

KevinMayfield commented 6 years ago

Url from HAPI Client is:

https://data.developer.nhs.uk/nrls-ri/metadata?_format=xml

Headers are:

Accept-Charset = [utf-8] Authorization = [deleted] fromASID = [200000000117] Accept = [application/fhir+xml;q=1.0, application/xml+fhir;q=0.9] toASID = [999999999999] User-Agent = [HAPI-FHIR/3.5.0 (FHIR Client; FHIR 3.0.1/DSTU3; apache)] Accept-Encoding = [gzip]

KevinMayfield commented 6 years ago

Can be closed from HAPI client perspective.

The work around for hapi client is to not use the setEncoding method:

clientNRLS.setEncoding(EncodingEnum.XML);

wilkinsm commented 5 years ago

As per above