在邮递员中创建api后,cakephp中缺少路线

时间:2018-11-21 07:36:32

标签: cakephp-3.6

我正在使用邮递员在cakephp3.6中创建post api,但是当我发送请求时却给出了类似

的错误
Missing Route
Error: A route matching "/apis/register" could not be found.

下面是我在config / route.php文件中的代码

Router::scope('/apis', ['Prefix' => 'apis'], function ($routes) {
    $routes->applyMiddleware('csrf');
    $routes->get('/all', ['controller' => 'Apis', 'action' => 'index']);
    $routes->post('/register', ['controller' => 'Apis', 'action' => 'register']);
});

如果有人知道解决方法,请帮忙。

0 个答案:

没有答案
相关问题