0

I couldn't call my service which gives an error

index.html:1 XMLHttpRequest cannot load http://localhost:14652/api/Employee. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:1873' is therefore not allowed access.

What should i do?

anoop m m
  • 315
  • 3
  • 11
  • Possible duplicate of ["No 'Access-Control-Allow-Origin' header is present on the requested resource"](http://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource) – Khalid Hussain Jan 06 '16 at 05:13

1 Answers1

0

Your browser won't let you make this request because the Access-Control-Allow-Origin (necessary for a cross-domain request) is missing in the header of whatever send your api, if you just want to make some tests you can disable it on your browser by launching it with the following flags:

google-chrome --disable-web-security --allow-file-access-from-files

But you should really read this : http://www.eriwen.com/javascript/how-to-cors/ and have cors working on your server

vatourni
  • 117
  • 1
  • 6