离子应用程序在另一个HTTP GET中使用HTTP GET崩溃

问题描述 投票:0回答:1

我正在使用Ionic4。为了避开CORS,我正在使用此插件-https://ionicframework.com/docs/native/http/

我打电话:

newurl = '<some google api url>';
this.http.get(newurl, {}, {}).then(data => {
      newurl = '<some other google api url>'
      this.http.get(newurl, {}, {}).then(data2 => {  //<=== this one fails

      }
}

第二个GET调用失败。因为该插件是Cordova,所以我必须在我的设备上运行它(不能使用ionic serve),而且我没有任何日志-Sentry日志服务没有向我发送任何内容。

我知道在升级到Ionic 4并使用旧的Http模块之前,我可以像这样链接调用-您现在不能这样做吗?如果是这样,我在做什么错?

cordova ionic-framework cordova-plugins ionic4
1个回答
0
投票

我弄清楚发生了什么-有冲突的Cordova插件具有不同版本的Ok HTTP,因此,在整理它们之后,一切正常。

© www.soinside.com 2019 - 2024. All rights reserved.