IIS 8.5 angularjs http Post 请求中的 405 方法不允许错误
405 Method not allowed error in angularjs http Post request with IIS 8.5
我在 iis 8.5
PHP 上的 angularjs 应用程序 运行 收到“405 方法不允许”错误
这些是我的 header 请求...
Access-Control-Allow-Headers:Content-Type, Accept
Access-Control-Allow-Methods:GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin:*
Allow:GET, HEAD, OPTIONS, TRACE
我能看到 post 在 "Allow:GET, HEAD, OPTIONS, TRACE"
中丢失了
谁能指导我如何在 IIS 8.5 中启用 POST 请求。
已解决
i finally solve this.... I guess the issue was in MY URL - api/login which is called in POST... i changes that URL with api/login/checklogin.php and executed POST request.... it works.......
SUPER THANKS TO LIN for his guidance and
http://whosebug.com always gives you the best.... THANKS ALL..
CORS 不影响 HTTP 状态代码 > HTTP 状态代码影响 cors。取自 的答案,您应该允许 IIS 中的所有 HTTP 请求类型
你需要。
对于 IIS 8.x 尝试:
您可以跟进 this guide 或在 applicationhost.config
文件中为您的实例进行以下更改:
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
还要确保从 web.config
中删除了 WebDAV 模块(如果已安装并启用):
<system.webServer>
<modules>
<remove name="WebDAVModule"/>
</modules>
<handlers>
<remove name="WebDAV"/>
</handlers>
</system.webServer>
我在 iis 8.5
PHP 上的 angularjs 应用程序 运行 收到“405 方法不允许”错误这些是我的 header 请求...
Access-Control-Allow-Headers:Content-Type, Accept
Access-Control-Allow-Methods:GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin:*
Allow:GET, HEAD, OPTIONS, TRACE
我能看到 post 在 "Allow:GET, HEAD, OPTIONS, TRACE"
中丢失了谁能指导我如何在 IIS 8.5 中启用 POST 请求。
已解决
i finally solve this.... I guess the issue was in MY URL - api/login which is called in POST... i changes that URL with api/login/checklogin.php and executed POST request.... it works.......
SUPER THANKS TO LIN for his guidance and
http://whosebug.com always gives you the best.... THANKS ALL..
CORS 不影响 HTTP 状态代码 > HTTP 状态代码影响 cors。取自
对于 IIS 8.x 尝试:
您可以跟进 this guide 或在 applicationhost.config
文件中为您的实例进行以下更改:
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
还要确保从 web.config
中删除了 WebDAV 模块(如果已安装并启用):
<system.webServer>
<modules>
<remove name="WebDAVModule"/>
</modules>
<handlers>
<remove name="WebDAV"/>
</handlers>
</system.webServer>