作者:viggieg-may_789 | 来源:互联网 | 2023-10-10 10:06
tryingtocalldatathroughopenweathermapapiifIcallitthroughGETmethod.thereis尝试通过openwe
trying to call data through openweathermap api if I call it through 'GET'method.there is
尝试通过openweathermap api调用数据,如果我通过“GET”方法调用它。有
405 (Method Not Allowed)
405(方法不允许)
var req = {
method: 'GET',
url: 'http://api.openweathermap.org/data/2.5/forecast/daily?APPID=' + ApiKey + '&q=London,us',
headers: {
'x-api-key': ApiKey
}
}
$http(req)
.then(function (data) {
console.log(data);
}, function (err) {
console.log(err);
});
2 个解决方案