2

I'm developing an Angular application and I'm using the default $httpService for the http requests.

The application run correctly on all my devices but not on my [G]old Samsung Galaxy s2 (using the default browser).

On the first request I get the following error:

{ 
  "data":null, 
  "status":-1, 
  "config": {
    "method":"GET", 
    "transformRequest":[null], 
    "transformResponse":[null],
    "url":"http://....",
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "Authorization": "Basic ....."
      } 
    },
  "statusText":""
}

I'm not able to figure out where the problem is.

The code is the following:

this.http.get(WebServices.localizations + this.currentLanguage.locale), success => {
            var localizationsJson = <any[]>success.data;
            var localizations = {};

            ....
        });

Thanks!

5
  • Can you show the code in which you make the request? Commented Nov 7, 2015 at 13:21
  • 1
    I0m using the get method of the http service, however I updated the question. Thanks Commented Nov 7, 2015 at 13:37
  • 1
    Is it making a CORS call? Commented Nov 8, 2015 at 4:26
  • 1
    Yes, it is making a CORS call Commented Nov 11, 2015 at 16:43
  • hi @user3471528 did you solve your problem ? Commented Jun 21, 2017 at 11:22

1 Answer 1

1

There was a change in the more recent versions of angular, with the handling of http status code 0.

Here is a github discussion based on the change.

I hope you have already solved you problem by now!

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

Comments

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.