Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to solve http status code -1 error

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);});
like image 772
Shashank G Avatar asked Oct 31 '25 13:10

Shashank G


1 Answers

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.

like image 122
Adam Reis Avatar answered Nov 02 '25 02:11

Adam Reis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!