-1

I am using $http.get to consume a REST api from IBM bluemix. However when I run this code

var url = "https://username:pass@cdeservice.mybluemix.net"
var count = '/api/v1/messages/count';
searchQuery = 'hi'
$http.get(url + count + "?q=" + searchQuery)
       .then(onResponse, onError);

I receive error 1012 - Error: Access to restricted URI denied. I am running on a server (access from localhost:6000) and I have even tried deploying and receiving the same error. Any solutions for this?

ralphearle
  • 1,696
  • 13
  • 18

1 Answers1

0

Try viewing here: Error: "Access to restricted URI denied"

Basically, many standard server/browser implementations will prevent these types of requests due to the Same origin policy being violated. Unless you controler the server, you may not be able to get around this issue.

Community
  • 1
  • 1
holtc
  • 1,780
  • 3
  • 16
  • 35