【问题标题】:405 error IIS8.0 POST method not allowed405 错误 IIS8.0 POST 方法不允许
【发布时间】:2013-12-05 19:30:54
【问题描述】:

我有一个运行 IIS8.0 的 Azure 云应用。
我有一个正在运行的 Wordpress 网站,我想向某个资源发出 POST 请求。
当我使用 REST 控制台时,它会使用 200 个代码成功。
当我使用 iOS 应用程序时,它会返回 405 错误,并显示“不允许使用方法 POST”的消息。

我检查了请求标头,它们完全一样。

我用谷歌搜索,发现它可能与 IIS 中的处理程序有关,因此这里是我的处理程序:

<handlers accessPolicy="Read, Script">
    <add name="PHP54_via_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.4\php-cgi.exe" resourceType="Either" />
    <add name="PHP53_via_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Either" />
    <add name="CGI-exe" path="*.exe" verb="*" modules="CgiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
    <add name="TRACEVerbHandler" path="*" verb="TRACE" modules="ProtocolSupportModule" requireAccess="None" />
    <add name="OPTIONSVerbHandler" path="*" verb="OPTIONS" modules="ProtocolSupportModule" requireAccess="None" />
    <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
</handlers> 

谁能帮我解决我的问题?

【问题讨论】:

    标签: wordpress iis http-post iis-8 http-status-code-405


    【解决方案1】:

    您可以尝试使用像 Wireshark 这样的网络数据包侦听器来查看 iOS 发送的原始 HTTP。

    【讨论】:

      【解决方案2】:

      我发现了导致问题的原因。 我想知道为什么从我的浏览器发送请求是有效的,而从 iOS 应用程序发送的却不是。

      浏览器和应用都发送完全相同的标头、有效负载和 url。

      网址是这样的:http://www.example.com/?json=subscribe/subscribe

      原来该应用无法使用此 URL。我不得不使用:http://www.example.com/index.php?json=subscribe/subscribe

      必须添加 index.php 才能使 iOS 工作。

      我正在将 Wordpress 添加到关键字中。

      【讨论】:

        猜你喜欢
        • 2019-07-05
        • 2012-10-26
        • 1970-01-01
        • 1970-01-01
        • 2017-10-16
        • 2014-05-23
        • 2012-08-24
        • 2018-02-16
        • 1970-01-01
        相关资源
        最近更新 更多