I am using an angular's http get method but whenever I load the page it throws status code -1 or 0 error response. What is the mistake I am doing here? How to resolve this ? What is the reason for this status code?
var requ = {
method: 'GET',
url: "https://...",
headers: {
"Content-Type": "application/json"
}
}
$http(requ).then(function(response){
$scope.details=response.data.platform.record;
}, function(response){alert("failure1");alert(response.statusText);});
We tend to get -1 status codes when there are network issues or connection problems, so we display the user a network problems page in those cases. It doesn't have to do with CORS as far as I'm aware.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With