I am getting this error when calling and I have to clue how to fix it
postData () {
var headers = new HttpHeaders();
headers = headers.set('Authorization','xxxxxxxxxxxxx');
headers = headers.set('Content-Type','application/xxxxxxxxxx');
headers = headers.set("Access-Control-Allow-Origin", "http://localhost:");
headers = headers.set("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
headers = headers.set("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Authorization, Origin, Accept");
// let requestOptions = {
// headers: new HttpHeaders()
// };
// requestOptions.headers = headers;
let body = {
grant_type:'password',
username:'user',
password:'user'
};
console.log(qs.stringify(body))
console.log(headers)
this.http.post(apiUrl,qs.stringify(body), {headers : headers} )
.subscribe(data=>{
console.log(data.toString)
});
}