我正在使用一个简单的Web API获取纬度和经度的天气详细信息(获取经度和经度我正在使用Geolocation插件)我没有得到所需的响应,而是401错误。我做错了吗?
以下是错误消息
这是我的代码:
weatherForLocation(latitude, longitude){
return new Promise(resolve => {
this.http.get("http://api.openweathermap.org/data/2.5/weather?lat=" + latitude + "&lon=" + longitude + "&appid=<bfab95ebe3bbb8966c54139aefd539b4>").map(res => res.json())
.subscribe(data => {
this.data = data;
resolve(this.data);
})
})
}