var settings = {
async: true,
crossDomain: true,
url: "http://10.250.252.1:43001/parameter-api/calculation/outlines/",
method: "GET",
headers: {
"Authorization": "Bearer AB2E2DB9C0894F0CAAE8ABBCBDA5E981",
"cache-control": "no-cache",
"Postman-Token": "e8b2a812-41c1-4b78-8e5b-2bbec1e9013f"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
i generated that code from postman, and everything works create there.
but when i try in javascript i get errors(in the console):
OPTIONS http://10.250.252.1:43001/parameter-api/calculation/outlines/ 404 (Not Found) Access to XMLHttpRequest at 'http://10.250.252.1:43001/parameter-api/calculation/outlines/' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
but when i remove my header i get only this error:
GET http://10.250.252.1:43001/parameter-api/calculation/outlines/ 401 (Unauthorized)
i use a cors extension for google chrome btw.
basicly i want to get data from that server, the server uses OAuth2 which i have a token for.
can someoen help me out.