AngularJS http.get returns 404

AngularJS http.get returns 404

我正在尝试使用 AngularJS 从 openweathermap.org API 获取 JSON,但我的请求 returns 出现错误代码 404。这是我的代码:

$scope.key = "XXXXXXXXXXXXX";

$scope.search = "Rouen"; $scope.url= "api.openweathermap.org/data/2.5/weather?q=" + $scope.search + "&APPID=" + $scope.key; $scope.fetch = function(){ $http.get($scope.url) .then(function(response){ $scope.res = response.data; $scope.status= response.status;}, function errorCallback(response) { alert(response.status);});

我试过请求另一个 url,但遇到了同样的问题:http://www.omdbapi.com/?t=Sherlock%20Holmes&tomatoes=true&plot=full

有人知道这里出了什么问题吗?

如果这很明显,请原谅我,我是 AngularJS 的新手,我还没有找到关于其他主题的任何解决方案。

提前感谢您的回答!

我看到的唯一错误是您没有在 url

之前设置 http://

这是我 chrome

上的回复
Request URL:http://api.openweathermap.org/data/2.5/weather?q=Rouen&APPID=XXXXXXXXXXXXX
Request Method:GET
Status Code:401 Unauthorized
Remote Address:192.241.169.168:80

当然是 401 Unauthorized APPID 无效