I'm doing a http
request here for a webservice apsh
, to make a request I do this:
validaLogin(user: User) {
var data = JSON.stringify({ email: user.email, senha: user.senha });
console.log(data);
return this.http.post(this.url, data)
.do(this.logResponde)
.map(this.extractData)
.catch(this.catchError);
}
private catchError(error: Response | any) {
console.log(error);
return Observable.throw(error.json().error || "Erro de conexção");
}
private logResponde(res: Response) {
console.log(res);
}
private extractData(res: Response) {
return res.json();
}
and in webservice
I get like this:
string email = context.Request.Form["email"];
string senha = context.Request.Form["senha"];
I can not change the ws
just the way to make a request.
The problem that is occurring is that everything null
is arriving.
Where am I going wrong?
I'm guessing it's a question of
body
or something like that.