Error "Endpoint returned a body with contentType 'text/html', while a valid FHIR xml/json body type was expected. Is this a FHIR endpoint?"

375 views
Skip to first unread message

dhi...@first-insight.com

unread,
Jun 23, 2017, 10:03:27 AM6/23/17
to FHIR DOTNET
Hi,

I am trying to make Update patient request but it is giving me following error

Endpoint returned a body with contentType 'text/html', while a valid FHIR xml/json body type was expected. Is this a FHIR endpoint?


Following is the code i am using 


               Dim fhirClient = New FhirClient("http://Localhost:49912/FHIR")
               Dim resultBundle= fhirClient.Update(Of Hl7.Fhir.Model.Patient)(pat)

If instead on Update i do Create it worked properly
  Dim resultBundle= fhirClient.Create(Of Hl7.Fhir.Model.Patient)(pat)

Actually I have to assign my custom id to patient so i have to use Update (because in create we can not mention id)

Can you please help me on this.

Thanks,
Dhiraj

Mirjam Baltus

unread,
Jun 23, 2017, 10:48:01 AM6/23/17
to FHIR DOTNET
Yes, your patient object needs to have the Patient.id field set, and also you need to supply the Update method with the location for this patient, which would be "Patient/[id]".
By the way, the result you will get back does not take the form of a Bundle, so I would rename "resultBundle" to just "result" to avoid confusion later on. Bundles are the result of a search, history, batch or transaction interaction.

dhi...@first-insight.com

unread,
Jun 26, 2017, 1:28:02 AM6/26/17
to FHIR DOTNET
Hi Mirjam,

I even tried by proving the id, it gives same error, 

The thing is that when i publish FHIR server in IIS and if i do Update request then it gives this error (However Create request works in this case too when it is published in IIS)
But suppose if i simply run the Spark Solution (Using F5 ) and then use that endpoint then both Create and Update request works fine,

Thanks,
Dhiraj

dhi...@first-insight.com

unread,
Jun 26, 2017, 1:34:08 AM6/26/17
to FHIR DOTNET
Is there any setting which i need to do in IIS for this?
Reply all
Reply to author
Forward
0 new messages