我收到此错误:
ERROR Error: "Uncaught (in promise): Error Code: 0
Message: Http failure response for https://xxxxxxxxxx.com/xxxxx: 0 Unknown Error[object Object]"
我将以下代码用于Ionic 4项目:
const headers = new HttpHeaders({ 'Content-Type': 'text/xml' });
return await this.http
.get("https://xxxxxxxxxx.com/xxxxx", { headers: httpHeaders })
.toPromise();
服务器https://xxxxxxxxxx.com设置为:接受允许来源CORS *
在浏览器中,请求为200 ok,并且有预期的数据