ionic应用程序无法通过HTTP请求连接到API

时间:2019-07-01 14:10:37

标签: ionic-framework

ionic应用程序无法通过HTTP请求连接到API。

var headers = new HttpHeaders({'x-watchover-key': this.apiKey}); this.http.get('http://xxxxxxxxxxxxxx/api/users/44/unclaimed', {headers: headers}).subscribe(data => {this.unclaimed=data;console.log(data);}, error => {console.log(error);});

下面给出错误

"headers":{:{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":"http://api/users/authenticate","ok":false,"name":"HttpErrorResponse","message":"Http failure response for http://api.watchover247.com/api/users/authenticate: 0 Unknown Error","error":{"isTrusted":true}

0 个答案:

没有答案