【问题标题】:Ionic 2 http.get android 500离子 2 http.get android 500
【发布时间】:2017-07-26 13:06:45
【问题描述】:

我尝试在 ionic 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中的结果:

Object {status: 500, error: "There was an error with the request"} 错误 : “请求出现错误” 状态 : 500

这里有一些来自 ionic 的信息

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

【问题讨论】:

    标签: android angular cordova ionic2


    【解决方案1】:

    答案很简单。我的测试设备失去了互联网连接。但 WLAN 状态看起来很正常 :-( 但是有点奇怪,我认为 500 表示服务器错误

    【讨论】:

      猜你喜欢
      • 2017-03-15
      • 1970-01-01
      • 1970-01-01
      • 2016-05-09
      • 1970-01-01
      • 1970-01-01
      • 2016-09-30
      • 2023-03-22
      • 2017-09-27
      相关资源
      最近更新 更多