I'm trying to send credentials via http request using Angular 2, but Angular 2 Http get request does not send credentials. What am I doing wrong?
var creds = "username=" + this.username + "&password=" + this.password;
var headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
http.get('http://localhost:3000', {
headers: headers,
credentials: creds
})
.map(res => res.json())
.subscribe(
data => this.data(data),
err => this.error(err),
() => console.log('Done')
);