错误MethodNotAllowedHttpException

时间:2018-06-06 17:51:23

标签: php lumen

NotFoundHttpException at 应用 - > handleDispatcherResponse(阵列(2,阵列(GET,POST))

$router->group(['prefix' => 'api'], function () use ($router) {
$router->post('contingent', ['as' => 'createContingent','uses' =>  'ContingentController@showById']);
$router->get('contingent', 'ContingentController@showAllContingent');
}

我以角度4:

访问此POST路由
$router->post('contingent', ['as' => 'createContingent','uses' =>  'ContingentController@showById']);

然后错误是:

MethodNotAllowedHttpException

at Application->在RoutesRequest.php第164行中的handleDispatcherResponse(array(2,array(GET,POST))

我的管腔应用或角度4有错误吗?

1 个答案:

答案 0 :(得分:0)

我想您在调用api/时忘记将前缀routes放入其中。使用your_domain.com/api/contingentGET请求

尝试此POST
相关问题