我正在使用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插件具有不同版本的Ok HTTP,因此,在整理它们之后,一切正常。