0

I have write code for saving simple data in sql through Web API after click save error are showing

"Access to XMLHttpRequest at 'http://localhost:2283/Help/api/Member' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. "

Can any one help me for this.

1 Answers1

0

So basically CORS protocol is present so someone cannot send requests on other sites, while loading your site (you've got your bank account open on the other tab, then you load another site which sends a command request to the bank's URL to transfer money for example. browser prohibits that under this protocol CORS)

The server you're connecting to has to allow (i.e whom ever is answering at this end: 'http://localhost:2283/Help/api/Member')

And there is a good manual to guide you through depending on what web server you're using: https://enable-cors.org/server.html

mehrdad
  • 131
  • 1
  • 3