Ionic get array from json - web service

i’m using

 import { HTTP } from '@ionic-native/http/ngx';

for http requests from ionic app. But it doesn’t working for me.

This codes from ionic framework documentation:

import { HTTP } from '@ionic-native/http/ngx';

constructor(private http: HTTP) {}

this.http.get(myJsonApiUrl, {}, {})
  .then(data => {

    console.log(data.status);
    console.log(data.data); // data received by server
    console.log(data.headers);

  })
  .catch(error => {

    console.log(error.status);
    console.log(error.error); // error message as string
    console.log(error.headers);

  });

This code not displaying error detail. Only display : “undefined” for error.error

sorry for my english.

Angular’s HttpClient is much more user-friendly. I would recommend using that instead. If you are going to respond with “I was doing that, and then I ran into CORS trouble”, then I’m going to say “CORS should really be fixed on the server side, not kludged around on the client side”.

What is the Result when you just log the error?