English 中文(简体)
Windows IIS: Windows IIS: 根据 PUT 请求返回 405 的虚拟目录
原标题:Windows IIS: Virtual directory returning 405 with PUT request

我在IIS上设置了一个虚拟目录, 我可以通过我的网络浏览器访问它, 我可以成功执行 Get 请求, 使用 PowerShell 命令 :

Invoke-Web request -Method Get -Uri http://my-directory/ - outFile my file

然而,当我尝试PUT的要求,例如:

Invoke-Web request - Method PUT - Uri http://my-directory/ - Infile my-files

I receive the following error HTTP Error 405.0 - Method Not Allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used. (full error message here)

我尝试了所有我在网上找到的解决方案, 包括从网络配置中删除 WebDAV 模块和处理器, 并将虚拟目录转换为应用程序。 我已确保所有动词都允许使用错误中提及的静态文件处理器 。

问题回答

您可以尝试在 Web. config 文件中添加下面的代码来解答这个错误 :

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




相关问题
Session Management with Windows Authentication

In an ASP.NET web app, using Integrated Windows Authentication, is the session tied to the windows identity? In other words, if I login (using IWA) to the app, and the app stores some "stuff" in my ...

Using Elmah with Cassini

Does anyone know if I can use Elmah with Visual Studio build-in web server(aka Cassini)? I get it working easily on IIS, but using same configuration, it doesn t work with Cassini. When I requested ...

Setting hostname in IIS, include www?

I want to set the hostname for a website I m adding in IIS 7, however do I include the www in the hostname or not? because I want both www.mysite.com and mysite.com both to point to mysite on the ...

inetpub versus any other folder

I ve run websites out of inetpub, as well as from folders just residing on the C: drive. I wonder, are there any definitive advantages to running websites out of inetputwwwroot?

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

热门标签