I'm having trouble getting responses from certain sites using http.get. Every get I do from Firebase seems to work, but many other sites do not, although the requests work fine from my browser or curl. I have two URL's that provide the exact same data, one from Firebase and another from a Cloud9 project. The Firebase one works and the c9 one doesn't.
When it doesn't work I get the following response:
{"data":null,"status":-1,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"http://dl-celeb-dp-x2jroy.c9users.io:8081/getScoreboard","headers":{"Accept":"application/json, text/plain, */*"}},"statusText":""}
I've tried HTTP as well as HTTPS for the one that isn't working but I get the same response either way.
I have a fiddle to demonstrate: https://jsfiddle.net/9d7mysns/
HTML:
<h1>{{result}}</h1>
<p>{{content}}</p>
</div>
Javascript:
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$http.get("https://blazing-torch-1276.firebaseio.com/getScoreboard.json") //Working
//$http.get("https://dl-celeb-dp-x2jroy.c9users.io:8081/getScoreboard") //Not Working
.then(function(response) {
$scope.result = "Success";
$scope.content = response;
}, function(response) {
$scope.result = "Error";
$scope.content = response;
});
});
Please help, Thanks!