MVC HttpDelete Verb that calls 405 Method not allowed

I use a method that allows an exception when you call a controller action that takes the word "Delete".

I thought the problem was that HandlerMappings in IIS 7.0 were wrong when I looked at:

ExtensionlessUrl-ISAPI-4.0_64bit
ExtensionlessUrl-ISAPI-4.0_32bit
ExtensionlessUrl-Integrated-4.0

Of course, they did not accept the verb DELETE. I added this to the list of verbs, but I'm still getting an error message, so I don’t understand why this is so. Can anyone shed some light on this?

+3
source share
1 answer

I found that this problem is caused by the WebDav module. I removed this from my web.config and this solved the problem.

<system.webServer>
 <modules runAllManagedModulesForAllRequests="true">
    <remove name="WebDAVModule" />
 </modules>
</system.webServer>

Hope this helps someone else!

+12
source

Source: https://habr.com/ru/post/1760441/


All Articles