$_post['creds']
为空:
let creds = "email=" + userDetails.email + "&password=" + userDetails.password;
let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' });
let options = new RequestOptions({ headers: headers });
this.http.post("http://www.dr-gontar.com/checkSignIn/", creds, options)
.subscribe((data:Response) => this.id = JSON.parse(data.text()).id);
this.http.post("http://www.dr-gontar.com/checkSignIn/", creds, options )
.subscribe((data:Response) => this.email = JSON.parse(data.text()).email);
this.http.post("http://www.dr-gontar.com/checkSignIn/", creds, options )
.subscribe((data:Response) => this.name = JSON.parse(data.text()).name);
this.http.post("http://www.dr-gontar.com/checkSignIn/", creds, options)
.subscribe((data:Response) => this.mobile = JSON.parse(data.text()).mobile);
this.http.post("http://www.dr-gontar.com/checkSignIn/", creds, options )
.subscribe((data:Response) => this.address = JSON.parse(data.text()).address);
this.userDetails = [this.id,this.email,this.name,this.mobile,this.address];
console.log(this.userDetails);
答案 0 :(得分:0)
sendUserAndPass(userDetails) {
let body = new URLSearchParams();
body.set('email', userDetails.email);
body.set('password', userDetails.password)
let headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
let options = new RequestOptions({ headers: headers });
this.http.post('url', body.toString(), options)
.map(res => res.json())
.subscribe(data => console.log(data))
}
然后你就可以得到你的电子邮件:
$_POST['email']