Access-Control-Allow-Origin Header and the ASP.NET Web API

Adding Header Information in Web.config

         <add name="Access-Control-Allow-Origin" value="*" />
         <add name="Access-Control-Allow-Headers" value="Content-Type" />
         <add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS" />
        <add name="Access-Control-Allow-Credentials" value="true" />

As you can see we have added keys with value for the listed items.


  • Access-Control-Allow-Origin (For Origin)
  • Access-Control-Allow-Headers (For Headers)
  • Access-Control-Allow-Methods (For Methods)

source :



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.