I am trying to get a JSON from the openweathermap.org API using AngularJS, but my request returns an error code 404. Here is my code :
$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);});
I have tried requesting another url, and got the same problem with this one : http://www.omdbapi.com/?t=Sherlock%20Holmes&tomatoes=true&plot=full
Does someone have an idea about what is wrong here ?
Forgive me if that is obvious, I am brand new in AngularJS and I haven't found any solution on other topics.
Thank you in advance for your answers !
//?