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有错误吗?
答案 0 :(得分:0)
我想您在调用api/
时忘记将前缀routes
放入其中。使用your_domain.com/api/contingent
或GET
请求
POST