0

We have an application running MVC4 front end an consuming a web api2 rest PUT. It is running in IIS 8.5 and windows server 2012

I am using PutAsync to update some data but getting a 405 - Method Not Allowed back. i looked around and found out that some people had this issue and it was resolved by using some or other technique in the web.config of the API.

I tried this in the web API config and it worked for me.

<modules runAllManagedModulesForAllRequests="true">
   <remove name="WebDAVModule" />
</modules>

<handlers>
 <remove name="WebDAV" />
</handlers>

BUT I am not sure why. i don't have any webdav authoring rules defined for my web site. Can someone please help me understand why this might be working for me??

Also, is there a downside of setting runAllManagedModulesForAllRequests=true for the API??

fireholster
  • 622
  • 1
  • 9
  • 22

1 Answers1

0

The configuration can be inhertied from machine.config. For more info,Configuration Inheritance in this page. It can also be inherited from any other web.config in a containing folder.

runAllManagedModulesForAllRequests implies that any request done to the folder (and subfolders) where you include this web.config will be handled to the registered modules. For example it will try to handle the request to something that doesn't look like a Web API action. Please, see this: <modules runAllManagedModulesForAllRequests="true" /> Meaning

Community
  • 1
  • 1
JotaBe
  • 38,030
  • 8
  • 98
  • 117