I'm calling a PHP file with the following code:
var link = 'link.php';
var data = JSON.stringify({ email: this.data.email, password: this.data.password});
let headers = new Headers();
headers.append('Content-Type', 'application/json');
this.http.post(link, data, { headers: headers }).subscribe(res => {
alert(res);
});
I'm echoing a string from the PHP file, but nothing is being stored in res. Is there something I'm missing, or am I completely going about it the wrong way?
Thanks