I have some trouble make PUT and DELETE CORS request to Web API on other domain.
I've coded API by tutorial http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api#create-webapi-project.
GET and POST Requests works fine, but DELETE and PUT doesn't. I get this message:
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource.
When I add code to WebConfig suggested on CORS support for PUT and DELETE with ASP.NET Web API , I get only first error.
Can anyone help me with this please?
You can add a handler to deal with this type of request.
Create a class derive from "DelegatingHandler":
Later in WebApiconfig.cs in Register method add this: