用于在Ionic 3框架中创建帐户的API-php magento2

用于在Ionic 3框架中创建帐户的API-php magento2,php,ionic-framework,ionic3,magento2.2,Php,Ionic Framework,Ionic3,Magento2.2,下面是带有、firstname、lastname、email和密码字段的注册html代码 ... <ion-item> <ion-label stacked>First Name</ion-label> <ion-input type="text" value="" [(ngModel)]="userData.fname"></ion-input> </ion-item> ... <button ion-but

下面是带有、firstname、lastname、email和密码字段的注册html代码

...
<ion-item>
  <ion-label stacked>First Name</ion-label>
  <ion-input type="text" value="" [(ngModel)]="userData.fname"></ion-input>
</ion-item>
...
<button ion-button full color="buttoncolor" class="signup" (click)="signup()">Signup</button>
用户已成功插入到数据库,但我没有收到响应

在注册函数中,当我执行console.log(this.responseData)时;此行返回NULL


我哪里出错了???

您的(Magento)注册端点是否返回一些数据?是的,它返回一个对象。我正在使用PHP和curl将数据插入数据库。您能否显示
authServiceProvider.postData
方法?和类PostData(凭证,类型){returnnewpromise((resolve,reject)=>{let headers=new headers();this.http.post(apiUrl+type,JSON.stringify(凭证),{headers:new HttpHeaders()}).subscribe(res=>{resolve(res);},(err)=>{reject(err);})
responseData : any;
userData = {
'customer': {
    "email":"",
    "firstname":"",
    "lastname":"",
    "storeId":1,
    "websiteId":1
},
"password":""
};

signup() {
//REST API connection to Magento 2 for Siging up a new customer
//this.navCtrl.push(HomePage);
this.authServiceProvider.postData(this.userData, "signup").then((result) => {
  this.responseData = result;
  console.log(this.responseData);
  localStorage.setItem('userData', JSON.stringify(this.responseData));
  this.navCtrl.setRoot(HomePage);
}, (err) => {
  //connection failed error message
});
}