Making http post request to webservice

Asked

Viewed 180 times

0

I’m making a requisition here http for a webservice apsh, to make request I do so:

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 the webservice receive like this:

string email = context.Request.Form["email"];
string senha = context.Request.Form["senha"];

I’m not in a position to change the ws only the way to request.

The problem is that everything is coming null.

Where am I going wrong ?

I’m thinking it’s a matter of body or something like that.

  • What’s the problem that’s happening?

  • He’s coming in like null

  • You can show how the method that receives the request is written?

  • This in the answer.

  • I meant the whole method of webservice

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.