263
Views
5
Comments
Reactive - Add custom HTTP header to EVERY server call

On a Reactive (Web or mobile) I want to add a custom dynamic HTTP header every time the device interacts with the server. (Aggregate, data refresh, Server Action or any other resource).

Things I have tried:

1) JavaScript override of XMLHttpRequest.send to include the header - It works for POST but not for a normal GET

2) Add a service worker to intercept requests and add the header - It works but... Found out later that OutSystems already uses a service worker under the wood and you can't have 2.

2020-09-18 09-37-36
Devendra Baghel

Hi Francisco,

You can try to add the custom HTTP header by using factory configuration. Below is the documentation 

https://www.outsystems.com/forums/discussion/44851/how-to-add-custom-response-headers-manipule-web-config-for-cases-like-cors/

Hope this will help.

Best Regards

Devendra


2018-10-25 14-51-08
pmmv999

Hi Devendra,

We want to send it as a Request HTTP Header, so this factory configuration solution isn't possible
The objective is for a proxy server catch that request to the server before process it

Thanks for your Reply

Greetings,
Pedro Vieira

2015-07-28 10-59-28
Francisco Silva

*Under the hood - in my defense it was already quite late...

 Devendra: Factory Configuration is for Response Headers as Pedro is saying. Thanks anyway.

2020-09-18 09-37-36
Devendra Baghel

Hi 

Yes I think you would need some kind of javascript hack to add custom header to each server request.

Best Regards

 Devendra

UserImage.jpg
Rui Gomes

Hello Francisco Silva and Pedro Vieira,

Have you found any solution for the described issue?

Best regards,

Rui Gomes

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.