0

Im trying to make a http request in Angular, and when i run it I get Unauthorized in the console. But if I run the request directly in the browser (Chrome) it works. Any suggestions how I can correct this?

$scope.getStorage = function() {

$http.get('http://username:[email protected]/api/storageinfo').success(function(response) {
    console.log(response);
    }).error(function(error){
        console.log(error);
    });
};

$scope.getStorage();

-

GET http://example.com/api/storageinfo/api/storageinfo 401 (Unauthorized)
4
  • You could send the basic authentication credentials correcly: stackoverflow.com/questions/18877715/… Commented Jan 9, 2017 at 13:19
  • I have tried those exampled, but can't get it to work. Commented Jan 9, 2017 at 13:39
  • Please share your back end code so we can understand better. Commented Jan 9, 2017 at 13:47
  • I can't. My API is Artifactory from jfrog. Commented Jan 9, 2017 at 13:50

0

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.