“405 method not allowed” in IIS7.5 for “PUT” method

后端 未结 20 2175
情深已故
情深已故 2020-11-28 02:15

I use WebClient type to upload *.cab files to my server. On the server side, I registered a HTTP handler for *.cab file with the PUT method as below:



        
20条回答
  •  执笔经年
    2020-11-28 03:00

    For whatever reason, marking WebDAVModule as "remove" in my web.config wasn't enough to fix the problem in my case.

    I've found another approach that did solve the problem. If you're in the same boat, try this:

    1. In the IIS Manager, select the application that needs to support PUT.
    2. In the Features View, find WebDAV Authoring Rules. Double-click it, or select Open Feature from the context menu (right-click).
    3. In the Actions pane, find and click on WebDAV Settings....
    4. In the WebDAV Settings, find Request Filtering Behavior, and under that, find Allow Verb Filtering. Set Allow Verb Filtering to False.
    5. In the Actions pane, click Apply.

    This prevents WebDAV from rejecting verbs that it doesn't support, thus allowing a PUT to flow through to your RESTful handler unmolested.

提交回复
热议问题