Json不是带有httpClients的对象

问题描述

.map(res => res.json())行出现错误。它与httpClient有关。谁能帮我解决这个问题

 pay(){
    let data = {
      amount: this.amount
    }
    let loader = this.ionLoading.create({
      content: 'Please Wait...'
    });
    loader.present();
    const options = {
      headers: new HttpHeaders().append('Content-Type','application/json')
    } 
    //send desired amount to server for payment
    this.http.post('http://localhost:3000/createPayment/',JSON.stringify(data),options)
    .map(res => res.json())
    //retrieve data and locate the returned link,open link using in-app-browser and approve payment.
    .subscribe(data => {
      console.log('Response From Server: ' + data.links[1].href);
      var browser = this.iab.create(data.links[1].href);
      loader.dismiss();
      this.amount = "";
    });
  }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)