I'm trying to Delete an object from database; I have an UI layer and a Service layer, I have loaded the UI and the Service separately on IIS.I am using asp.net web api and i send the request with http delete method.So when i run services(with f5)and send the delete request to http:// localhost:15957/
all thing is ok.
But when i send the request to the site that host in iis get this error:
HTTP Error 405.0 - Method Not Allowed
I look at the response header and and see the unexpected header:
Allow:GET, HEAD, OPTIONS, TRACE
I dont add this header.
On the Web.config of the Service layer I'm adding the following to the header for CORS:
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type, x-xsrf-token" />
<add name="Access-Control-Allow-Methods" value="PUT, GET, POST, DELETE" />
</customHeaders>
What is my problem?