Only GET request works, POST, PUT and DELETE this locked

Asked

Viewed 169 times

0

I am implementing the Entityframework in a system that is based on selects, Insert... When I make a request POST or PUT this giving second error. The get method is working normally. .net 4.7.2

By Swagger works, Postman works, by front(Angularjs) error

Access to Xmlhttprequest at KOSHERhttp://localhost:56223/close box/close box' from origin KOSHERhttp://localhost:9090' has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.

already has the tags on the web.config

<customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
    <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
  </customHeaders>
  • Take a look at these answers: https://stackoverflow.com/questions/18619656/enable-cors-in-web-api-2

  • Resolved with your reply, thank you very much

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.