Skip to content Skip to sidebar Skip to footer

Getting Status -1 Instead 401 Angularjs

I'm trying to get a response from server. The function looks so: function getOverview() { var req = { method: 'GET', url: base, headers:

Solution 1:

When doing cross-site requests, the server has to add to ALL responses a valid CORS header. This includes error responses like 401.

Make sure you can see the "Access-Control-Allow-Origin" header in your 401 response, it's most likely missing.

Post a Comment for "Getting Status -1 Instead 401 Angularjs"