Knowledge Management Banner

Knowledge Management Banner

CORS - Access-control-allow-origin header not present [SOLVED]

In this tutorial we will study how to make the Web Api publically available for any domain.

Add following in your Wb.Config file in System.WebServer

  <httpProtocol>  
    <customHeaders>  
     <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" />  
    </customHeaders>  
  </httpProtocol>  





11 comments:

  1. how to active it in 000webhost?

    ReplyDelete
  2. SAME QUESTION HERE
    IN GO DADDY OR WORDPRESS

    ReplyDelete
  3. Hi I am using JSP for a Iframe. I am having the same issue but where should i copy this piece of code as i dont have web.config.

    ReplyDelete
  4. it Works in sites.google.com "classic" for add external archives to blogger?

    ReplyDelete
  5. not solved buddy .....as i am also using angularjs

    ReplyDelete
  6. God Bless you bro, it solved my problem!

    ReplyDelete

  7. Fantastic post.

    Really enjoyed reading it and it held my attention all the way through! Keep it up.

    Read my Latest Post

    ReplyDelete
  8. Can you please help me on how to do the same in an angular application to fetch ssrs reports..thank you!!

    ReplyDelete
  9. how to add this header in .net core api

    ReplyDelete

Powered by Blogger.