Request being Barred by CORS policy

0

I'm trying to mount my Front End using the Icinga API, but I'm constantly encountering the following error:

  

Access to XMLHttpRequest at   ' link '   from origin ' link ' has been blocked by CORS policy:   In 'Access-Control-Allow-Origin' header is present on the requested   resource.

I've tried everything, I've seen all the possible tutorials on the internet and I could not. But what makes me more curious is that I can make this same request for Postman without any difficulty.

Remembering that:

  • I am making a request for an API that has Basic Auth, the login and password, I am passing in the Header, encrypted, but without success.
  • The same thing being done in Postman, does not return any error, quite the contrary, I went straight through without any headache.
  • Now, my doubts focus on the following: How does Postman do this and if there is a possibility I can see the request that was made by Postman, so I can copy it.

    $.ajax({
        url: "url",
        crossDomain: true,
        data: "",
        dataType: 'json',
        success: function (data) {
            console.log(data);
        },
        type: 'GET'
    });
    
        
    asked by anonymous 12.12.2018 / 23:34

    0 answers