How to make a cross domain HttpRequest to the Restful API in Javascript
Hi All,
I would like to share a way to overcome Cross Domain security issue.
It happens when you are making a HTTP Request from a WEB Server, let’s say, SERVER 1, to a WEB Service hosted in SERVER 2.
To avoid the security issue, add a Request Header to your HTTP Request object:
httpRequest.setRequestHeader('X-PINGARUNER', 'pingpong');
This will allow you to do Cross Domain calls.
Cheers,
Rogerio
Hi Rogerio!
Thanks for this post!
Maybe this document could help too:
http://scn.sap.com/docs/DOC-61118
Regards,
Anthony
Hi Anthony,
The advantage of this approach is that it can be used at client side, so the user can do it without having to access the CMS.
Cheers,
Rogerio