简体   繁体   English

405错误IIS8.0 POST方法不允许

[英]405 error IIS8.0 POST method not allowed

I have an Azure cloud app running IIS8.0. 我有一个运行IIS8.0的Azure云应用程序。
I have a Wordpress site running on it and I want to make a POST request to a certain resource. 我有一个Wordpress网站正在运行,并且我想对某个资源发出POST请求。
When I use a REST console it succeeds with 200 code. 当我使用REST控制台时,它会成功显示200个代码。
When I use a iOS app it returns an 405 error with the message "Method POST is not allowed". 当我使用iOS应用程序时,它返回405错误,并显示消息“不允许方法POST”。

I checked the request headers and they are exactly the same. 我检查了请求标头,它们完全相同。

I googled and I found out it may have something to do with the handlers in IIS, therefor here are my handlers: 我搜索了一下,发现它可能与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> 

Can anybody help me with my issue? 有人可以帮我解决我的问题吗?

I found out what was causing the issue. 我发现了导致问题的原因。 I was wondering why sending a request from my browser was valid and from the iOS app was not. 我想知道为什么从浏览器发送请求是有效的,而从iOS应用程序发送请求却无效。

Both the browser and the app were sending exactly the same headers and payload and url. 浏览器和应用程序都发送完全相同的标头,有效负载和url。

The url was something like this: http://www.example.com/?json=subscribe/subscribe . 网址是这样的: http : //www.example.com/ ?json=subscribe/ subscribe

Turns out the app wasn't able to use this URL. 原来该应用无法使用此URL。 I had to use: http://www.example.com/index.php?json=subscribe/subscribe 我必须使用: http : //www.example.com/index.php?json=subscribe/subscribe

The index.php had to be added for iOS to work. 必须添加index.php才能使iOS正常工作。

I'm adding Wordpress to the keywords. 我将Wordpress添加到关键字中。

您可以尝试使用Wireshark之​​类的网络数据包侦听器查看iOS发送的原始HTTP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Wordpress运行导入程序错误405不允许 - Wordpress run importer error 405 Not allowed 错误 405 - 不允许 | Wordpress 网站托管在 github 页面上,Xampp 服务器在本地计算机上 - Error 405 - Not Allowed | Wordpress website hosted on github pages with Xampp server on Local Machine Nginx-405不允许-fastcgi超时 - Nginx - 405 NOT ALLOWED - fastcgi timeout 在 Wordpress.com 上使用 REST API 发布 [错误 401,不允许] - Post with REST API on Wordpress.com [Error 401, not allowed] 表单方法=发布时出现错误404 - ERROR 404 when form method=post Wordpress:wp_update_post返回错误“允许的内存大小耗尽” - Wordpress: wp_update_post returns Error “Allowed memory size exhausted” Wordpress:wp-admin中的自定义帖子类型列表页面返回“ Allowed memory size Error” - Wordpress: List page of custom post type in wp-admin return “Allowed memory size Error” 从 WordPress 调用 API 时出现 405 错误 - 405 Error When Calling API From WordPress 当我输入wordpress https://EXCOM/EXCOMMENT.COM./WP-COMMENTS.COMMENTS.SPAMP 404重定向不发生 - When I enter wordpress https://example.com/wp-comments-post.php, I get a http 405 error. 404 redirect does not occur Wordpress无法删除媒体文件错误信息:您不允许删除此信息 - wordpress cannot delete media file error message: you are not allowed to delete this post
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM