4

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);});
3
  • seems like CORS issue !!! Commented Jan 25, 2017 at 5:36
  • what is that cors ?how to solve it @LolCoder아카쉬 Commented Jan 25, 2017 at 5:40
  • please check with including 'Access-Control-Allow-Origin': '*', inside headers Commented Jan 25, 2017 at 5:43

2 Answers 2

11

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.

Sign up to request clarification or add additional context in comments.

7 Comments

Agree that status -1 would of network issues or connection problems. Any specific network issues you are aware?
I think just basic network connectivity, could be a multitude of reasons, like no wifi, no ethernet, lost connection, etc.
HTTP status -1 is purely related to certificate error for accessing domain. It may be expired or might be certificates are not valid... Developers can open chrome browser by adding flag --ignore-certificate-errors to skip these error, if end users faces issues, only option is renew certificates with valid certificates authorities..
It's definitely not just for certificate errors, as it occurs when there's no internet connection as well. Perhaps certificate errors also result in a -1 error code though.
If this kind of errors comes at browser end, is there any a way to get control to collect browser console data programmatically with javascript
|
-2

if you use:

@grantolator:;3#8defect (ionic)/codebuilder\ !infection073!"73.98.12=infection {"status":-1,"code":""} UnInfect"73.98.12 apply

or you can use

.inspection."@¤=+!" In a form of (Identify.Altoffer.Complete%20") "Apply=((true))""inspect"-True=defect-" Gamerule. False

This should Work

1 Comment

This answer isn't clear. Use code back-ticks and punctuation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.