douchi5822 2011-12-20 03:16
浏览 32
已采纳

Symfony2 POST路由在Facebook iFrame中返回404

I have a route that looks like this:

SiteGameBundle_GameFinish:
    pattern:  /game/finish
    defaults: { _controller: SiteGameBundle:Game:finish }
    requirements:
        _method:  POST

If I manually make a POST request with curl, the page successfully returns the correct path.

However, if I attempt to call the URL with AJAX it returns 404 every time. When I inspect the request data, the URL and the request method are all set appropriately. I can't figure out what would cause Symfony2 to return a 404 error in this instance.

  • 写回答

1条回答 默认 最新

  • douji4223 2011-12-20 04:12
    关注

    This had nothing to do with being AJAX or non-AJAX.

    Apparently adding a trailing slash to the route creates a 404 error.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效