I'm working on an Angular project. I need to test API call from the Angular app but it's not working. It returns me error,
Access to XMLHttpRequest at 'http://...../api/v1/user/authen' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
On the Sever has already set Access-Control-Allow-Origin: '*'
I also made a simple html+Jquery file to test calling API and it works perfectly.
function callApi(){ $.ajax({ type: "POST", url: 'http://..../api/v1/user/authen', data: { "user": "admin", "password": "123456" }, success: function(data){ console.log(data); }, }); } But from the Angular APP I still got the error. Is there anything I need to specifically set on Angular app ?