表单提交为GET Laravel 4 [英] Form submits as GET Laravel 4

查看:71
本文介绍了表单提交为GET Laravel 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的表格

<form action="{{ Request::root() }}/articles/update/" method="post">
    <input type="hidden" name="id" value="{{ $article->id }}" />
    <input type="submit" name="submit" value="Submit" />
</form>

像这样的路线

Route::post('articles/update', array('as' => 'articleUpdate', 'uses' => 'ArticlesController@update'));

但是当我提交表单时,我得到了MethodNotAllowedHttpException.在错误报告中,我可以看到请求方法是GET.我也尝试对方法method="POST"使用大写字母,但没有用.

But when I submit the form, I get MethodNotAllowedHttpException. In error report I can see that request method is GET. I have also tried using caps for method method="POST" but it didn't work.

有什么想法吗?

推荐答案

FireBug/Web控制台检查器向您显示什么?表单是通过GET还是POST发送的,是否有任何重定向?

What does FireBug/Web console inspector show you? is the form being sent via GET or POST, any redirects?

对于我来说,似乎是一个重定向问题,在到达服务器后,Laravel将表单重定向至发送了发帖请求的URL.

Seems a redirection problem to me, after reaching the server Laravel redirects to the URL the form sent the post request.

这篇关于表单提交为GET Laravel 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆