I’d like to know if there is a way to change the accept header of the http request then set it back to its original value?
I am calling a flow service which I want to set the accept language to “en-US”, but the original language was “ar-OM”.
Once I done from the service I set the Accept Language back to “ar-OM”
Thanks & Regards
I’m not sure I understand the need. Is your service doing something specific to honor (or override) the accept lanuage? Perhaps if you describe what you’re trying to achieve with this approach someone can provide guidance. E.g. what is leading you to want to override the accept language header?
Thanks for your quick reply
I built a flow service called PIRS and this service is getting the Accept language from the pub.flow:getTransportInfo from the transportInfo document type (transportInfo/http/requestHdrs/Accept-Language)
And based on the headers language I display my output.
I built another service called CRS, this service is calling PIRS when I call the PIRS I have only to set the accept language to “en-US” because some times when I call the CRS remotely I can set the accept language to “ar-OM”
I hope you get what I want
If you can, modify PIRS to accept a new input parameter. When it runs, check if that new input is set. If it is use it, else use the requestHdrs/Accept-Language.
Thank you reamon for your reply
But what if there is another service calling CRS which calls PIRS. Do I have to do the same?
You’re going to need to figure out the logic to be supported and make the appropriate coding changes. My suggestion was simply one way to have PIRS honor a specific language instead of using the accept language header.
I know its all about logic, but its a matter of how to implement it.
I thought of another way is by using a config file which contain the defalut language.
if the default is en then set the langauge to en, if * then the language from the Accept-Language.