Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel post请求返回一个不允许的方法_Php_Laravel_Laravel 5 - Fatal编程技术网

Php Laravel post请求返回一个不允许的方法

Php Laravel post请求返回一个不允许的方法,php,laravel,laravel-5,Php,Laravel,Laravel 5,在我的路由文件中,我有 Route::post('/request-rest-password', 'HomeController@requestResetPwd'); 在控制器中 public function requestResetPwd(Request $request){ return $request; } 现在每当我尝试post时,它总是抛出一个错误 “例外情况”: “Symfony\Component\HttpKernel\Exception\Method

在我的路由文件中,我有

Route::post('/request-rest-password', 'HomeController@requestResetPwd');
在控制器中

  public function requestResetPwd(Request $request){
      return $request;
  }
现在每当我尝试post时,它总是抛出一个错误

“例外情况”: “Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException”,“文件”: “/var/www/html/freegorer/vendor/laravel/framework/src/illumb/Routing/RouteCollection.php”

我哪里会出错 帖子示例

$ curl -X POST -H "Accept: application/json" -F "email=test@test.com" -F  ....... 
        "http://localhost:8000/request-reset-pwd"
您有一个输入错误:

路由:
请求休息密码

POST:
请求重置pwd

Route::post('/request-rest-password', 'HomeController@requestResetPwd')->name('post_insert');
您的表单html应该包含如下路径

<form method="post" action="{{route('post_insert')}}">
{{csrf_field()}}
  your user fields goes here...
</form>

{{csrf_field()}}
您的用户字段位于此处。。。

这将是你的链接:谢谢,我看到了我花了1小时才犯的愚蠢错误debugging@GEOFFREYMWANGI哈哈,这些事情都会发生