I tried to send post request with FormData using Angular2. But my webserver reach nothing and send me back error code 500. I checked request with PostMan util (GoogleChrome addons). And i found that i reach 500 only when i send nothing.
let Form = new FormData();
Form.append("username", this.username);
Form.append("password", this.password);
let headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
this.http.post("/ajax/rest_login",
Form,
{headers: headers})
.map((res: Response) => res.json())
.subscribe(
res => console.log(res.text()),
err => console.log(err),
() => console.log('done'));
What i'am doing wrong? Maybe you know better way to post FormData