Hello, I'm trying to do a POST method that returns me a 'User' object.
In my BackEnd I have the following code:
//Add um Usuarios
public Usuarios Post([FromBody]Usuarios usuario)
{
return _usuariosServices.Adicionar(usuario);
}
That is, I get a 'User' object.
In the angle I call this method and the request arrives in the BackEnd, but I can not play the return on an angle variable ...
My Angular method is 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(() => {});
}
So I understand, it is necessary to do something inside the 'Subscribe', but I do not know what this something is ... Thanks in advance ...