Is it possible to add cookie to the request while using IRestFulClient from HAPI-FHIR?
Asked
Active
Viewed 285 times
1 Answers
0
This could be done quite easily by creating a custom interceptor which adds a cookie header. You can see an example of a client interceptor which adds an authorization header here. If you copy that code but change the header from "Authorization" to "Cookie", then register the interceptor by calling
client.registerInterceptor(interceptor);
..you will get that behaviour.
Incidentally, if you create such an interceptor and wanted to share it back with the project, we'd love to have it! :)

James Agnew
- 701
- 4
- 3
-
Hi James, thanks for your quick response:) I created a new interceptor and it works for my cases. https://github.com/jamesagnew/hapi-fhir/pull/35 – Petro Mykhailyshyn Oct 17 '14 at 09:59