Hello community ,
Actually I am trying to call an externel rest api that 's deployed in the same server as CRM ( with a different port ) using javascript
CRM url : http://server:5555/organisation
Api url : http://server:9091/operation/id
here is my code
{
var req = new XMLHttpRequest();
req.open("GET", url, true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.send();
req.onreadystatechange = function() {
if (this.readyState === 4) {
this.onreadystatechange = null;
if (this.status === 200) {
// do something ;
} } }; }
But i get this following error :
Access to XMLHttpRequest at Api url from origin 'http://server:5555' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Does any one had already faced this kind of issue ??Or have any workaround ?
Please let me Know !!
Ps: I work on CRM 2015 on premise
*This post is locked for comments