Hi Team,
we are trying to find a common place to make a generic function to add headers to rest api calls ,
We have explored onbefore request, but our auth-token is stored in local storage in a blank module and
we can't figure out how to pass local storage data from blank module to a service module.
Please help us resolving this query ASAP.
Hi Aditya,
As I see it, you have two ways:
1. Your REST API is called synchronously from your app - you can have the header as a parameter of the REST API and fill it with the value you want, like on the image below:
2. Your REST API is called asynchronously - in that case, you will have to store the value in the database and fill it on the OnBeforeRequest or in a parameter as in the image above. When you run the REST API asynchronously, there is no way the server side can obtain information from the client side, so saving it in the database is the way to do so, in order to have access to the data when consuming the REST API on the server side.
Kind Regards,João
is there any way to have a database specific to a particular app and not stored in the outsystem's server .
Hi,Although Joao had already mentioned an approach; but here's something that I would like to highlight:
Hope it helps;
Assif