0
I am making a POST request in my API by my angular project and only empty the result, and by Postman comes the correct data.
service ts. :
teste(user) {
return this.http.post(`api/home`, user)
}
test.componentts.:
ok(user){
this.loginServ.teste(user)
.subscribe(data => {
let retorno = (data as any)
console.log(retorno);
})
}
Return only comes empty and I can not understand the pq of this. Anyone can help?
why not use . then() instead of . subscribe()?
– Paz
continues with the problem using the . then()
– Maria