Enable Cross-Origin Requests in ASP.NET Web API 2

11.5k views Asked by At

I wrote a Web API program It is run in local windows server and I tested it in other local windows server. But when I uploaded it in Plesk hosting, it does not work and I got this error:

404 - File or directory not found.

I set only one specific item in web.config

 <httpProtocol>
  <customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
  </customHeaders>
</httpProtocol>

my sample API address is Here.

Should I set a specific setting?

0

There are 0 answers