Mobile 为设备中的离子3调用API的正确方法

Mobile 为设备中的离子3调用API的正确方法,mobile,ionic3,Mobile,Ionic3,当前我的帖子不起作用,给我一个错误“this.http.post(…).map不是函数” 我在想,如果你能帮我修改这个代码的离子应用程序,这是正确的方法吗 我的形象 承认{ let headers=新的headers() headers.append('Accept', 'application/json'); headers.append('apikey', 'myApI'); let formData = new FormData(); formData.append('file', thi

当前我的帖子不起作用,给我一个错误“this.http.post(…).map不是函数”

我在想,如果你能帮我修改这个代码的离子应用程序,这是正确的方法吗

我的形象

承认{ let headers=新的headers()

headers.append('Accept', 'application/json');
headers.append('apikey', 'myApI');
let formData = new FormData();
formData.append('file', this.myImage, this.myImage.name);
this.http.post('https://api.taggun.io/api/receipt/v1/simple/file', formData, {headers: headers})
  .map(res => res.json()).subscribe(data =>{
    console.log(data);
    this.data = data;
    this.navCtrl.push(ScanResultsPage, {data: data})
  });
}
var headers = new Headers();
headers.append("Accept", 'application/json');
headers.append('Content-Type', 'application/json' );
const requestOptions = new RequestOptions({ headers: headers });

let postData = {
        "name": "Krunal",
        "email": "test@gmail.com",
        "tel": "12345678"
}

this.http.post("URL WILL HERE", postData, requestOptions)
  .subscribe(data => {
    console.log(data['_body']);
   }, error => {
   console.log(error);
});