【问题标题】:Laravel Azure App Service Delete Method Not AllowedLaravel Azure 应用服务删除方法不允许
【发布时间】:2019-10-01 10:45:47
【问题描述】:

在 Azure 的应用服务中托管一个 laravel 应用,每次 Web 应用发出 DELETE 请求时,它都会抛出 405 Method Not Allowed 并返回以下消息:

The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.

我已经用尽了我在互联网上可以找到的所有选项,并尝试了所有提到的东西。希望有人能帮忙。

【问题讨论】:

    标签: laravel azure azure-web-app-service


    【解决方案1】:

    如果您的应用程序使用 .NET WebAPI,当您发出 PUT 或 DELETE 请求时,您可能会收到 405 Method Not Allowed 错误。 这个错误是因为WebDAV module intercepted the request

    在您的 web.config 中,尝试插入此代码

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

    这个问题与this question重复

    【讨论】:

    • 不熟悉 .NET WebAPI。应用程序是用 Laravel 构建的。
    猜你喜欢
    • 1970-01-01
    • 2018-01-25
    • 1970-01-01
    • 1970-01-01
    • 2020-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多