How to modify default Accept/Content-Type values in request headers

29 views
Skip to first unread message

Rupeshit Patekar

unread,
Dec 14, 2022, 10:16:44 PM12/14/22
to HAPI FHIR
Hello All,

I'm creating restfulGenericClient object to store entities in Kotlin.

val client: IGenericClient = FhirContext.forR5().newRestfulGenericClient("SERVER_BASE")

Now as per our CDR server requirement, I would like to modify Accept and Content-Type parameters to send extra information in the request header. However, I'm not able to modify them. I tried using AdditionalRequestHeadersInterceptor & SimpleRequestHeaderInterceptor, however, they are adding new headers instead of modifying default header values.

Hence is there any way to modify or remove default request headers like Accept, Content-type and pass them with my custom values?




Reply all
Reply to author
Forward
0 new messages