I'm getting my Bad Request 400 response to my API call in my console:
Myapp.api.tsintheappfolderis:
exportconstMEAT_API='http://localhost:1337'
Andmymaincodeis:
submit(){varlink='http://localhost:1337/user/login';vardata='?email='+JSON.stringify(this.usuario.email)+'&senha='+JSON.stringify(this.usuario.senha);this.http.post(link,data).subscribe(data=>{this.data.response=data._body;if(this.data.response!="[]"){
var resposta = this.data.response;
console.log(resposta);
// tinha que pegar o ID do usuário.... :/
sessionStorage.setItem("usuarioEmail", this.usuario.email);
//sessionStorage.setItem("idUsusario", resposta[0].idusuarios);
sessionStorage.setItem("flagLogado", "sim");
this.navCtrl.setRoot(WellFitPage, {}, {animate: true, direction: "forward"});
}else{
let alert = this.alertCtrl.create({
title: 'Usuário Não encontrado!',
subTitle: 'Verifique se digitou seu e-mail e senha corretamente.',
buttons: ['OK']
});
alert.present();
}
})
}
I'm migrating from Ionic 1 to 3 a lot has changed. What can it be? My API was developed using SailsJS.
In my Postman, it seems right, see: