Ionic 2 http.get android 500

时间:2017-07-26 13:06:45

标签: android angular cordova ionic2

我尝试在离子2中制作一个http.get。它在ios上工作正常但在android中没有。

checkHTTP() {
  console.log('checkHTTP');
  return this.http.get('http://apiv3.iucnredlist.org/api/v3/version', {}, {})
    .then((data) => {
      console.log(data);
    })
    .catch((error) => {
      console.log(error);
    })
}

这是android中的结果:

  

对象{状态:500,错误:"请求错误"}   错误   :   "请求出错了#34;   状态   :   500

以下是离子的一些信息

Cordova CLI: 7.0.1
Ionic Framework Version: 3.5.3
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 2.0.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.4
Xcode version: Not installed

1 个答案:

答案 0 :(得分:-1)

答案很简单。我的测试设备丢失了互联网连接。但WLAN-Status看起来很正常:-( 但有点奇怪,我认为500意味着服务器错误

相关问题