I am trying to obtain a .json file from remote server (parse, firebase, amazon).
function fetchData(remoteJsonId){
var url = "https://myAppName.parseapp.com/"+remoteJsonID+"?callback=JSON_CALLBACK";
console.log(url); //This variable expands to the full domain name which is valid and returns success both on wget and the browser
$http.jsonp(url).then(
function(resp){
},
function(err){
console.log(err.status) // This posts "404" on console.
}
);
}
But If I open url in the browser the json file loads. Even if I wget url the json file loads. But through angular it returns a 404 not found. Why is angulars $http
is returning 404 even though the file exists. Any solutions for this?