【问题标题】:GET hanging on redirectGET挂在重定向上
【发布时间】:2012-12-20 17:21:25
【问题描述】:

我可以看到 POST 在 firebug 控制台中完成,我看到 GET 开始,但挂起并且永远不会结束。有没有人遇到过这种情况和/或知道是什么原因造成的?

路线:

Route::post('recipes/submitList', array('uses'=>'recipes@submitList'));
Route::get('results/list', array('as'=>'list', 'uses'=>'recipes@list'));

控制器:

class Recipes extends Base_Controller{
    public function post_submitList(){
            // builds array from DB
            // etc
    return Redirect::to_route('list')
        ->with('list', $ingrs);
}
public function get_list(){
    return View::make('list')
        ->with('title', 'Your Shopping List!');
    }
}

此外,如果我通过 console.log(response) 回显响应,我会从我想要重定向到的页面中获取所有 HTML。但是,在控制台中循环的 GET 没有响应,但确实有“200 OK [cycle-gif] 313ms”。

【问题讨论】:

  • 引导程序顶部是否有error_reporting(E_ALL)
  • 尝试运行 fiddler (fiddler2.com/fiddler2) 并确保 GET 不会陷入无限循环
  • 感谢提琴手提示...我不知道我在看什么,但原始标题中有一些奇怪字符的屏幕:i.imgur.com/22iE2.jpg

标签: php laravel


【解决方案1】:

在您的 Get http 动词中,您使用的是“results/list”,也许它应该是“recipes/list”。

Route::get('recipes/list', array('as'=>'list', 'uses'=>'recipes@list'));

【讨论】:

  • 我可以先试一试,然后告诉你。第一部分是查询(或 uri),它是一个硬名称,并使用告诉它哪个控制器@方法。敬请期待……
  • 没有骰子。谢谢你的想法。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-05-19
  • 2014-10-26
  • 2014-04-06
相关资源
最近更新 更多