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

后端 未结 20 2038
情深已故
情深已故 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 02:45

    Another important module that needs reconfiguring before PUT and DELETE will work is the options verb

    <modules>
    <remove name="WebDAVModule" />
    </modules>
    <handlers>
    <remove name="OPTIONSVerbHandler" />
    <remove name="WebDAV" />
    <add name="OPTIONSVerbHandler" path="*" verb="*" modules="ProtocolSupportModule" resourceType="Unspecified" requireAccess="Script" />
    </handlers>
    

    Also see this post: https://stackoverflow.com/a/22018750/9376681

    0 讨论(0)
  • 2020-11-28 02:46

    I had this problem but nothing related to WebDAV was the issue. In my case, the client was sending a POST to www.myServer.com/api/chart. This call should be handled by the "ExtensionlessUrlHanlder-Integrated-4.0", however, somehow a local file structure was created in my server directory "...\Server\api\chart\". This meant that the "StaticFile" handler was being called instead. Deleting those local files finally solved the problem.

    0 讨论(0)
  • 2020-11-28 02:47

    Taken from here and it worked for me :

    1.Go to IIS Manager.

    2.Click on your app.

    3.Go to "Handler Mappings".

    4.In the feature list, double click on "WebDAV".

    5.Click on "Request Restrictions".

    6.In the tab "Verbs" select "All verbs" .

    7.Press OK.

    0 讨论(0)
  • 2020-11-28 02:47

    For Windows server 2012 -> Go to Server manager -> Remove Roles and Features -> Server Roles -> Web Server (IIS) -> Web Server -> Common HTTP Features -> Uncheck WebDAV Publishing and remove it -> Restart server.

    0 讨论(0)
  • 2020-11-28 02:47

    If IIS app pool is running under classic mode, make sure you have the following in your web.config

    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
    
        <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" modules="IsapiModule" scriptProcessor="c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
    
    0 讨论(0)
  • 2020-11-28 02:48

    I had this problem with WebDAV when hosting a MVC4 WebApi Project. I got around it by adding this line to the web.config:

    <handlers>
      <remove name="WebDAV" />
      <add name="WebDAV" path="*" verb="*" modules="WebDAVModule"
          resourceType="Unspecified" requireAccess="None" />
    </handlers>
    

    As explained here: http://evolutionarydeveloper.blogspot.co.uk/2012/07/method-not-allowed-405-on-iis7-website.html

    0 讨论(0)
提交回复
热议问题