【问题标题】:HTTP verb POST used to access path '/' is not allowed in Facebook appFacebook 应用程序中不允许用于访问路径“/”的 HTTP 动词 POST
【发布时间】:2011-01-15 11:41:12
【问题描述】:

我正在尝试使用 4.2.1 C# SDK 构建简单的 facebook 应用程序。但我有一个错误:

The HTTP verb POST used to access path '/' is not allowed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The HTTP verb POST used to access path '/' is not allowed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The HTTP verb POST used to access path '/' is not allowed.]
   System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +2488621
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841400
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

我正在使用来自 this SO Q&A 的 Web.config。

【问题讨论】:

    标签: c# .net asp.net facebook facebook-c#-sdk


    【解决方案1】:

    我不使用 ASP.NET,但我想说你必须在某个地方处理 POST 请求。您可能还想在 Facebook 上的应用程序设置中禁用 POST for canvas

    【讨论】:

      【解决方案2】:

      虽然 Canvas URL 值必须以“/”结尾,但 Tabl URL 可以是完全限定页面(例如 http://example.com/dir/Default.aspx)。

      我在本地工作,所以 http://localhost:4604/Main/Default.aspx 为我工作。

      【讨论】:

        【解决方案3】:

        出于安全原因,将不再选择禁用画布上的帖子,read about it 特别是时间线部分。如果您使用的是 asp.net 开发服务器,我建议您发布到您的 Web 服务器,这样可以避免其他问题。

        【讨论】:

          【解决方案4】:

          在 Facebook 画布 URL 中添加此内容:http://localhost.local:3088/Default.aspx/ 它对我有用

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2011-07-11
            • 1970-01-01
            • 2011-06-04
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2011-12-21
            相关资源
            最近更新 更多