4

I have an AngularJS app hosted in nginx server at localhost and Rest service hosted in Weblogic at localhost:7001.

I'm trying to do this post inside of Angular part:

$http.post('localhost:7001/testApp/user/login', { username: username, password: password })
            .success(function (response) {
                callback(response);
});

And this is the error I'm getting:

XMLHttpRequest cannot load localhost:7001/testApp/user/login. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Andrey Saleba
  • 2,167
  • 4
  • 20
  • 27

1 Answers1

3

You should specify the protocol scheme (http, https, ...) in the URL:

$http.post('http://localhost:7001/testApp/user/login', { username: username, password: password })
        .success(function (response) {
            callback(response);
});
aghidini
  • 2,855
  • 5
  • 29
  • 32