Stream: implementers
Topic: Return Preference header with Conditional Create
David Moorhouse (Sep 22 2020 at 06:29):
What should the server return where a conditional create matches an existing resource and the return preference header (prefer: return=representation) is set ?
Specification for Conditional Create says to ignore the POST when a matching resource is found and return 200 OK. Documentation for the header says it only applies to POST/PUT/PATCH operations and Should return the resource content
My hunch is the header should be obeyed and the resource should be returned as the body of the response rather than the terse response.
René Spronk (Sep 22 2020 at 06:49):
Related: I created a change request to clarify that in case of a match the server should populate the Location response header. (which most public FHIR servers do, but there is no wording to that effect in the spec).
David Moorhouse (Sep 22 2020 at 06:51):
Thx René - that would be useful as the client can then use the returned Location header to work with the resource.
René Spronk (Sep 22 2020 at 07:00):
Exactly - that's why my client does. Location will be populated, irrespective of whether there was a match or not.
Last updated: Apr 12 2022 at 19:14 UTC