0
Hello, I’m trying to make a POST method that returns me an object 'User'.
In my Backend I have the following code:
//Add um Usuarios
public Usuarios Post([FromBody]Usuarios usuario)
{
return _usuariosServices.Adicionar(usuario);
}
That is, returns me an object 'User'.
At the angle I make the call of this method and the request arrives in the Backend, but I cannot play the return in an angle variable...
My Angular method ta as follows...
CriandoUsuario(usuario: UsuariosModel){
let headers = new Headers();
headers.append('Content-Type', 'application/json')
this.http.post(`${API}` + 'Usuarios'
, JSON.stringify(usuario)
, { headers: headers })
. subscribe(() => {});
}
From what I understand, it is necessary to do something within the Subscribe, but I do not know what that something is... Thank you in advance...