-1

I am trying to send a username and password to a rest service, but I keep getting this error. I read that I need a header("Access-Control-Allow-Origin: *"); to get past this, but I don't understand where it goes. Does it go in the client side application or the server side? And where exactly?

John
  • 1
  • The server you're sending the username and password should reply to you with the Access-Control-Allow-Origin: * header. – David Corbin Jul 02 '15 at 17:35

1 Answers1

1

Access-Control-Allow-Origin is an HTTP response header. It is sent from the server (your REST API in this case) in the response for the data requested.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • 1
    ... And if you are in the position to set that header you should think twice if it is a good idea to set an asterisk or a specific host: http://www.html5rocks.com/en/tutorials/cors/ – Marged Jul 02 '15 at 17:32