2013-11-21 153 views
0

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

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

我用Google搜索,我发现它可能是与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> 

任何人可以帮助我与我的问题?

回答

0

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

1

我发现是什么导致了这个问题。 我想知道为什么发送来自我的浏览器的请求是有效的,并从iOS应用程序不是。

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

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

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

index.php必须添加为iOS的工作。

我将Wordpress添加到关键字。