My goal is to retrieve data from an API located at this URL: ''. I have properly set up all the required modules...
I attempted to access the API using the 'get()' method of the 'HttpClient' class like so: get(this.api, {headers: apiheader})
const httpOptions = {
headers: new HttpHeaders({
'Content-type': 'application/json',
'Autorization': 'EpCuVuAOPGfoXNyXtDxDxNIozMxQ
7TC9W9C9FBlZsgUExQLH2zNOmFmWKnMBKKPE'
})
};
api="http://apis.coursefrenzy.com/courses/";
getUser(){
return this.http.get(this.api, {headers: httpOptions.headers});
}
However, when I subscribe to this method and log the data to the console, an error message appears...
Access to XMLHttpRequest at '' from origin 'http://localhost:6565' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.enter image description here