を送ったbeeingていませんコンソールログに表示されます。私はjsonとurl-encodingでコードを送信しましたが、どちらもコードに実装されています。どんなイデアですか?ご助力ありがとうございます!HTTPリクエストが、私はこれを得た私の<strong>サーバー</strong>で
EDIT:私の新しいコードは、まだここ
を失敗している:
var to_send = JSON.stringify({"username": username, "password": password});
//var to_send = 'username='+username+'&password='+password;
var headers = new Headers();
headers.append('Content-Type', 'application/json');
//headers.append('Content-Type', 'application/x-www-form-urlencoded');
this.http
.post('http://localhost:8080/', to_send, {
headers: headers
})
.map(response => response.json())
.subscribe(
response => this.returned = data,
() => console.log('Request sent')
);
return "";
ので、任意のアイデア? :(
私もNode.jsのためにちょっと新しいんだけど、それは 'req.body'のではないでしょうか? – lexith
@lexithこれは、 'application/json'と' to_send'でjson形式で試してみると、未定義の – DigitalEvolution
を与えるでしょうか? – lexith