IIS 7.5 +为 RESTFul 服务启用 PUT 和 DELETE,无扩展

发布于 2024-11-24 21:03:06 字数 853 浏览 2 评论 0 原文

我试图了解 IIS 7.5 如何处理 POST 和 PUT 请求。

我正在使用 OpenRasta 框架编写 RESTful 服务。 POST 操作可以正常工作,但对同一 URL 的 PUT 操作则不然。它返回如下错误,

Detailed Error Information
Module: IIS Web Core
Notification: MapRequestHandler
Handler: StaticFile
Error Code: 0x80070002

url 如下“http://localhost/MyService/Resource.Something.manifest”

相同的设置在 Visual Studio 开发 IIS 中工作正常。

解决方案

基本上默认的ExtensionlessUrlHandler不接受PUT和DELETE动词。只需添加它们即可。

<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" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />

i am trying to understand how IIS 7.5 handles POST and PUT request.

I am writing a RESTful service using OpenRasta framework. The POST operation works without any problem, but the PUT operation for the same URL does not. It returns error like the following

Detailed Error Information
Module: IIS Web Core
Notification: MapRequestHandler
Handler: StaticFile
Error Code: 0x80070002

the url is like this following "http://localhost/MyService/Resource.Something.manifest"

Same setup works fine in visual studio development IIS.

Solution

Basically the default ExtensionlessUrlHandler does not accept PUT and DELETE verb. Just need to add them.

<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" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(15

遗忘曾经 2024-12-01 21:03:06

为了让 IIS 7.5 接受 PHP 5.4 快速 CGI 驱动的 REST API 的 PUT 和 DELETE,我必须禁用 WebDAV 模块。否则,WebDAV 模块将使用 PUT 或 DELETE 来干预 HTTP 请求。然而,要完成这项工作有点令人困惑,我可能错过了一些步骤或以其他顺序完成。

这些行作为应用程序根目录中 web.config 元素的子元素放置。

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

希望这可以减少一些挫败感。似乎服务器的默认设置是接受任何未列出的 HTTP 谓词 - 请参阅 请求过滤 -> 下的设置HTTP 动词 ->编辑功能设置。人们可以考虑明确添加允许的动词。允许的动词可以在附加此片段后指定,也可以作为 的子级。

    <security>
        <requestFiltering>
            <verbs allowUnlisted="false">
                <add verb="GET" allowed="true" />
                <add verb="POST" allowed="true" />
                <add verb="DELETE" allowed="true" />
                <add verb="PUT" allowed="true" />
            </verbs>
        </requestFiltering>
    </security>

在客户端计算机上,可以从此处卸载 WebDAV 模块:

Control Panel -> Uninstall Program -> Turn Windows features on or off -> IIS -> World Wide Web Services -> Common HTTP feautre -> WebDAV Publishing

使其正常工作的最后一种方法是编辑 C:\Windows\System32\inetsrv\configapplicationhost.config代码>.在 内-> 您将看到一个只有 verb="GET,HEAD,POST 的 php 条目 - 修改它以添加您需要的动词,例如:

<add name="PHP54_via_FastCGI" path="*.php" verb="GET,HEAD,PUT,DELETE,POST"/>
                                                                 |
                                                                 |
                                                                 |
append verbs here  ----------------------------------------------|

To get PUT and DELETE to be accepted by IIS 7.5 for a PHP 5.4 fast-CGI driven REST API I had to disable the WebDAV-module. Otherwise the WebDAV module intervenes the HTTP requests using PUT or DELETE. To get this working was however a bit confusing and I might have missed some steps or done it in another order.

These lines are placed as children of the <system.webServer>-element in web.config in the application root.

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

Hopes this might spare some frustration. It seems like the default setting for the server is to accept any HTTP verb not listed - see settings under Request filtering -> HTTP Verbs -> Edit feature Settings. One may consider to explicitly add the VERBS that are to be allowed. The verbs allowed may be specified appending this snippet, also as a child of <system.webServer>.

    <security>
        <requestFiltering>
            <verbs allowUnlisted="false">
                <add verb="GET" allowed="true" />
                <add verb="POST" allowed="true" />
                <add verb="DELETE" allowed="true" />
                <add verb="PUT" allowed="true" />
            </verbs>
        </requestFiltering>
    </security>

On a client machine one can uninstall the WebDAV module from here:

Control Panel -> Uninstall Program -> Turn Windows features on or off -> IIS -> World Wide Web Services -> Common HTTP feautre -> WebDAV Publishing

The last measure to get it working was by editing applicationhost.config found in C:\Windows\System32\inetsrv\config. Within <system.webServer> -> <handlers> you will see a php entry that has just verb="GET,HEAD,POST - amend it to add the verbs you require, e.g.:

<add name="PHP54_via_FastCGI" path="*.php" verb="GET,HEAD,PUT,DELETE,POST"/>
                                                                 |
                                                                 |
                                                                 |
append verbs here  ----------------------------------------------|
回忆那么伤 2024-12-01 21:03:06

1.进入IIS管理器。
2.单击您的应用程序。
3.转到“处理程序映射”。
4.在功能列表中,双击“WebDAV”。
5.点击“请求限制”。
6.在“动词”选项卡中选择“所有动词”。
7. 按确定。

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.

黑色毁心梦 2024-12-01 21:03:06

请参阅http://learn.iis.net/page.aspx/901 /iis-express-faq/ 是从 OR wiki 链接的。

从链接(为了便于阅读,未使用块引用):

答:您可以修改 %userprofile%\documents\IISExpress\config 文件夹中的 IIS Express applicationHost.config。例如,要为无扩展 URL 启用 PUT 和 DELETE,请向下滚动到 IIS Express applicationHost.config 文件的底部,并查找以以下

内容开头的处理程序条目:

verb 属性中添加 PUTDELETE,以便 verb 属性看起来像: verb="GET、HEAD、POST、DEBUG、PUT、DELETE"

See http://learn.iis.net/page.aspx/901/iis-express-faq/ that is linked from the OR wiki.

From the link (not block-quoted for readability):

A: You can modify the IIS Express applicationHost.config in the %userprofile%\documents\IISExpress\config folder. For example to enable PUT and DELETE for extensionless Urls scroll down to the bottom of the IIS Express applicationHost.config file and look for a handler entry that starts with:

<add name="ExtensionlessUrl-Integrated-4.0"

In the verb attribute add PUT and DELETE so the verb attribute looks like: verb="GET,HEAD,POST,DEBUG,PUT,DELETE".

七秒鱼° 2024-12-01 21:03:06

我的场景是 IIS 7.5 上网站中的 Web 应用程序。该网站必须继续启用 WebDAV,但 Web 应用程序需要将其关闭才能在其 REST API 中支持 PUT 和 DELETE。

为了使其正常工作,Web 应用程序的 Web.config 需要这样:

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

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

与此处其他答案的重要区别是需要 runManagedModulesForWebDavRequests="true"

My scenario was a web application in a web site on IIS 7.5. The web site had to continue to enable WebDAV, but the web application needed to turn it off in order to support PUT and DELETE in its REST API.

To get that working, the web application's Web.config needed this:

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

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

The important difference from the other answers here is the need for runManagedModulesForWebDavRequests="true"

落日海湾 2024-12-01 21:03:06

对我来说,这在 web.config 中起到了作用。

<system.webserver>
    <handlers>
          <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" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />

          <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
<system.webserver/>

<system.web>
  <authentication mode="Windows" />
  <identity impersonate="true"/>
<system.web/>

我使用了以下配置:

  • IIS 7.5
  • Windows Server 2008 R2
  • 自定义应用程序池,.NET 4.0,集成
  • Windows 身份验证 = true
  • 匿名身份验证 = false

希望它有所帮助。 ;-)

For me this does the trick in the web.config.

<system.webserver>
    <handlers>
          <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" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />

          <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
<system.webserver/>

<system.web>
  <authentication mode="Windows" />
  <identity impersonate="true"/>
<system.web/>

I used following configuration:

  • IIS 7.5
  • Windows Server 2008 R2
  • Custom Application Pool, .NET 4.0, Integrated
  • Windows Authentication = true
  • Anonymous Authentication = false

Hope it helps. ;-)

椒妓 2024-12-01 21:03:06

URLScan 工具用户

如果其他答案仍然不起作用并且您收到 404 错误:如果您安装了 URLScan 工具,这些动词可能会被明确拒绝。

您可以配置 URLScan.ini 文件的 [AllowVerbs][DenyVerbs] 部分来满足您的需求。

谨防安全风险< /a> 启用这些动词。

URLScan tool users

If other answers still don't work and you get 404 error: these verbs may be explicitly rejected by the URLScan tool, if you have it installed.

You can configure [AllowVerbs] and [DenyVerbs] sections of the URLScan.ini file to meet your needs.

Beware of the security risks of enabling these verbs.

迷乱花海 2024-12-01 21:03:06

对我有用的是完全卸载 WebDav。

What worked for me was uninstalling WebDav completely.

冷心人i 2024-12-01 21:03:06

尽管 PUTDELETE 已经被列为已处理动词,但进入处理程序映射并设置 WebDAV 来处理所有动词是唯一对我有用的事情。我的工作 web.config 是:

  <system.webServer>
    <handlers>     
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <remove name="WebDAV" />
      <add name="WebDAV" path="*" verb="*" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" />
    </handlers>
  </system.webServer>

Going into the handler mappings and setting WebDAV to handle all verbs is the only thing that worked for me, despite the fact that PUT and DELETE were already listed as handled verbs. The working web.config I have is:

  <system.webServer>
    <handlers>     
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <remove name="WebDAV" />
      <add name="WebDAV" path="*" verb="*" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" />
    </handlers>
  </system.webServer>
梦中楼上月下 2024-12-01 21:03:06

在 web.config 中,

<system.webServer>
    <handlers>
        <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
</system.webServer>

您还可以使用 IIS 管理 UI 并全局定义它,或默认 Web 服务器

in the web.config

<system.webServer>
    <handlers>
        <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
</system.webServer>

you can also use the IIS management UI and define this globally, or default web server

被翻牌 2024-12-01 21:03:06

我在 IIS 8 中尝试过。

  • **卸载 WebDav Publishing

    卸载步骤
    ->控制面板->转到程序和功能 ->开窗
    功能打开或关闭->选择互联网信息服务->World Wide
    Web 服务 -> 常见 HTTP 功能 -> 通过取消选中 WebDAV 选项“删除”WebDAV 发布**

I tried in IIS 8.

  • **uninstall WebDav Publishing

    Steps to uninstall
    -> Control Panel -> Go to Programs and features -> Turn windows
    featues on or off-> Select Internet Information Services->World Wide
    Web Services->Common HTTP Featues->"Remove" WebDAV Publishing by unchecking WebDAV option**

谜兔 2024-12-01 21:03:06

500错误的原因!

大家好,

我也想发布我自己的研究成果,希望对未来的爱好者有所帮助。
正如答案中所建议的,我无法卸载 WebDav,因此我在 Web 配置中添加了以下行(来自其他答案),

 <system.webServer>
    <handlers>
        <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
</system.webServer>

但当我启用调试模式时,我收到了 500 错误,发现了这个

 Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ExtensionlessUrlHandler-Integrated-4.0'

答案

由于处理程序映射部分中已存在 ExtensionlessUrlHandler,因此请执行以下操作来解决该问题。

方法 1

1) 转到 IIS 管理器并选择您的应用程序

2) 转到处理程序映射功能

3) 找到 ExtensionlessUrlHandler-Integrated-4.0 并将其删除。

4)在您的webconfig中添加ExtensionlessUrlHandler(如上面的答案所述)

<system.webServer>
<handlers>
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>

方法 2

1) 从您的 Web 配置中删除 ExtensionlessUrl 处理程序

2) 在 IIS 服务器中单击您的应用程序,转到 HandlerMappings

3) 找到 ExtensionlessUrlHandler-Integrated-4.0(仅此名称,忽略其他名称)

4) 右键单击它并选择编辑

编辑处理程序

5) 单击在“请求限制”上并选择“动词”选项卡和“请求限制”选择所有动词,

这将使无扩展处理程序允许所有动词。

我将使用方法 1,因为我们可以在 web.config 中进行控制。但请确保你
检查部署服务器是否有重复的处理程序定义。

Reason for 500 error !

Hi all,

I want to post my own research too, I hope it would help future enthusiasts.
As suggested in answers, I can't uninstall WebDav so I have added the line below in web config (from other answers)

 <system.webServer>
    <handlers>
        <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
</system.webServer>

but I got a 500 error, when I have enabled debug mode found this

 Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ExtensionlessUrlHandler-Integrated-4.0'

Answer

Its because there was already an ExtensionlessUrlHandler in the handler mappings section, do the following to resolve the issue.

Method 1

1) Go to Your IIS Manager and select your app

2) Go to Handler Mappings feature

3) Find ExtensionlessUrlHandler-Integrated-4.0 and delete it.

4) Add ExtensionlessUrlHandler in your webconfig (as mentioned in above answers)

<system.webServer>
<handlers>
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>

Method 2

1) Remove ExtensionlessUrl handler from your web config

2) Click on your app in IIS Server, go to HandlerMappings

3) Find ExtensionlessUrlHandler-Integrated-4.0 (only this name, ignore others)

4) right click on it and choose Edit

edit handler

5) click on 'Request Restrictions' and select Verbs tab & choose All Verbs

this will enable extensionsless handler to allow all verbs.

I will go with method 1, as we can have control in web.config. But make sure you
check the deployment server for duplicate handler definitions.

云淡风轻 2024-12-01 21:03:06

我的 web.config 与 asp.net core 1.0

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <modules>
      <remove name="WebDAVModule" />
    </modules>
    <handlers>
      <remove name="WebDAV" />
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>

My web.config with asp.net core 1.0

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <modules>
      <remove name="WebDAVModule" />
    </modules>
    <handlers>
      <remove name="WebDAV" />
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>
恋你朝朝暮暮 2024-12-01 21:03:06

Windows Server 2012中。
使用管理员权限在记事本中打开 applicationHost.config 文件

applicationHost.config 文件位于 C:\Windows\System32\inetsrv\config

找到注意

 <verbs allowUnlisted="false" applyToWebDAV="true">
   <add verb="GET" allowed="true" />
   <add verb="HEAD" allowed="true" />
   <add verb="POST" allowed="true" />
   <add verb="DELETE" allowed="false" />
   <add verb="TRACE" allowed="false" />
   <add verb="PUT" allowed="false" />
   <add verb="OPTIONS" allowed="false" />
</verbs>

DELETE 和 PUT HTTP 动词设置为 false。
将它们更改为 true。

现在应如下所示

 <verbs allowUnlisted="false" applyToWebDAV="true">
   <add verb="GET" allowed="true" />
   <add verb="HEAD" allowed="true" />
   <add verb="POST" allowed="true" />
   <add verb="DELETE" allowed="true" />
   <add verb="TRACE" allowed="false" />
   <add verb="PUT" allowed="true" />
   <add verb="OPTIONS" allowed="false" />
</verbs>

保存文件。您已在 Web 服务器上启用 HttpPut 和 HttpDelete 请求

In windows server 2012.
Open applicationHost.config file in notepad with Administrator rights

applicationHost.config file is found in C:\Windows\System32\inetsrv\config

Locate the section

 <verbs allowUnlisted="false" applyToWebDAV="true">
   <add verb="GET" allowed="true" />
   <add verb="HEAD" allowed="true" />
   <add verb="POST" allowed="true" />
   <add verb="DELETE" allowed="false" />
   <add verb="TRACE" allowed="false" />
   <add verb="PUT" allowed="false" />
   <add verb="OPTIONS" allowed="false" />
</verbs>

Notice DELETE and PUT HTTP Verbs are set to false.
Change them to true.

It should now read as below

 <verbs allowUnlisted="false" applyToWebDAV="true">
   <add verb="GET" allowed="true" />
   <add verb="HEAD" allowed="true" />
   <add verb="POST" allowed="true" />
   <add verb="DELETE" allowed="true" />
   <add verb="TRACE" allowed="false" />
   <add verb="PUT" allowed="true" />
   <add verb="OPTIONS" allowed="false" />
</verbs>

Save the file. You have enabled HttpPut and HttpDelete requests on your web server

夏见 2024-12-01 21:03:06

主要解决方案是从特定网站模块的部分中删除 webdavmodule 。

因此,您可以从 IIS 和 webconfig 中执行此操作。

The main solution is to remove webdavmodule from the specific website'd module's section.

So you can do it from both IIS and in webconfig.

征﹌骨岁月お 2024-12-01 21:03:06

我正在处理同样的问题。我的解决方案是在 Plesk Panel 中关闭 Web 应用程序的防火墙模式。

输入图片此处描述

I was dealing with the same problem. The solution for me was to turn off the Firewall mode of the Web Application in Plesk Panel.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文