title: Ionic 4 & RxJS 6: Ionic-native HTTP get method doesn't return data from the server
body: <p>I am migrating from angular <code>HttpClient</code> Module to <code>ionic-native HTTP</code>, as it is impossible to access a third-party API using the standard HttpClient Module. I want to make the test of the application as easy as possible: that means, while I am adding feature to the application on my computer, I may use <code>HttpClient</code>; and while I am testing out that in a real-device, I can also do so by migrating to <code>ionic-native HTTP</code> and change a few lines of code. </p>
  
  <p>The <code>HttpClient</code> works just perfectly fine in my app while I am testing it out on my computer.</p>
  
  <p>My <code>service</code> written in HttpClient Module:</p>
  
  <pre><code>  getCaiyunForecast(): Observable&lt;any&gt; {
      return this.http.get(this.forecastUrl)
        .pipe(map((res: any) =&gt; { return res; }), catchError(this.processHttpmsg.handleError))
    }
  </code></pre>
  
  <p>My <code>service</code> written in <code>ionic-native HTTP</code>:</p>
  
  <pre><code>  getCaiyunForecast(): Observable&lt;any&gt; {
      return of(this._http.get(this.forecastUrl, {}, {})
        .then(res =&gt; { return JSON.parse(res.data) }, res =&gt; console.log(res.data)));
    }
  </code></pre>
  
  <p>When I am subscribing to the service in my <code>HomePage</code>:</p>
  
  <pre><code>this.caiyunForecastService.getCaiyunForecast()
    .subscribe(res =&gt; {
      for (let i = 0; i &lt; 3; i += 1) {
        let value = this.convertService.convertSkycon(res.result.hourly.skycon[i].value)
        this.hourlyWeather.push({
          temperature: res.result.hourly.temperature[i].value.toFixed(0),
          skycon: value,
          precipitation: res.result.hourly.precipitation[i].value.toFixed(1),
          wind: {
            speed: res.result.hourly.wind[i].speed,
            direction: res.result.hourly.wind[i].direction
          },
          cloudrate: res.result.hourly.cloudrate[i].value
        });
      }
    })
  </code></pre>
  
  <p>When I do console.log in my service (<code>console.log(res.data)</code>), no value is outputted. And a "Cannot read property of hourly is undefined" is errored out; therefore, I suspect that no data is returned from the server. </p>
  
  <p>Is there something I did wrong? How may I change it to make it working?</p>