google / fhir-gateway

A generic proxy server for applying access-control policies for a FHIR-store.
Other
70 stars 28 forks source link

Add support for altering the HTTP verb in request mutations #295

Open ndegwamartin opened 2 weeks ago

ndegwamartin commented 2 weeks ago

The proposal is to add the ability to alter the HTTP Verb from a GET to POST during request mutation. The GET request faces limitations when we have a request with multiple query parameters which can be circumvented using POST payloads.

One benefit of this to to avoid the URI too large exception when adding extra URL params at the gateway level (e.g. location identifiers)

To avoid any possible side effects we probably want to replace the entire request with a newly constructed one of the target HTTP verb. Ideally we want to 1) Construct a POST payload/body 2) strip/move all query parameters to the payload 3) Make a POST style request to the FHIR Server.

It is worth noting that some FHIR client implementations e.g. the HAPI FHIR generic client internally implement this switch when it detects that request url is too long (over 8000 characters) , see https://hapifhir.io/hapi-fhir/docs/client/generic_client.html