I'm trying to make a POST request to an API and I'm receiving this error:
XMLHttpRequest cannot load http://*. Response for preflight has invalid HTTP status code 400 However, when I try to make a GET request, it works.
My get method:
getMethod() {
return this.http.get<PerfilModel[]>(globals.BASE_URL + 'perfis');
}
My post method:
updateMethod(changePass: ChangePassModel) {
let h = new Headers();
h.append('Content-Type', 'application/json');
return this.http2.post(globals.BASE_URL +
'users/passwords/redefinitions/' +
changePass.key, JSON.stringify(changePass),
{ headers: h }
).map(res => res.json);
}
observation: the cors toggle plugin is activated.