I need to enable CORS for my Web API and I can't upgrade to Framework 4.5. I've tried to add the following to my Web.config to see if it worked, but it didn't:
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Accept,Content-Type,X-Requested-With"/>
I am accessing the URL http://localhost:8484/api/values/ from ajax call
and getting bellow error
XMLHttpRequest cannot load http://localhost:8484/api/values. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 405.