So I am trying to send a GET Request in my JavaScript via AJAX. The problem is that I can send the Request in Postman and it works fine. When I use the feature to generate the AJAX code and I insert it in the my local index.html the Request seems to be blocked.
var settings = {
"async": true,
"crossDomain": true,
"url": "http://www.bibsonomy.org/api/posts?resourcetype=bookmark&group=ukp&format=json",
"method": "GET",
"headers": {
"Authorization": "Basic key",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Console output:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
at https://www.bibsonomy.org/api/posts?resourcetype=bookmark&group=ukp&format=json.
(Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
I have no idea why it is not working and why Postman does not get this error.