Someone could help me I have a problem. But I can not interpret it.
user.service.ts
postUser(user:User):Observable<User[]>{
let body = JSON.stringify(user);
let headers = new HttpHeaders({
'Content-Type': 'application/json'
});
return this._http.post<User[]>(this.listaUserURL, body, { headers })
//.pipe(map( res => {return res}));
.pipe ();
}
user.component.ts
saveUser() {
this._appUserService.postUser(this.user)
.subscribe((data :User[]) => {console.log(data)});
}
ERROR This is the error that comes to me
Access to XMLHttpRequest at ' link ' from origin ' link ' has been blocked by CORS policy: Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.