不允许使用 Slim Framework 方法。必须是以下之一:POST (405)
Slim Framework Method not allowed. Must be one of: POST (405)
我已经在 slim 框架中编写了 REST api。当我从浏览器调用 authenticate API 时,它通过 'Method not allowed. Must be one of: POST'。以下是我的代码,请指正我哪里错了。
Index.php
<?php
require 'vendor/autoload.php';
require 'Authenticate.php';
$app = new \Slim\App;
$app->post('/api/authenticate', \Authenticate::class);
$app->run();
.htaccess
RewriteEngine On
RewriteRule ^ index.php [QSA,L]
URL
http://localhost/project/api/authenticate
我已经在 slim 框架中编写了 REST api。当我从浏览器调用 authenticate API 时,它通过 'Method not allowed. Must be one of: POST'。以下是我的代码,请指正我哪里错了。
Index.php
<?php
require 'vendor/autoload.php';
require 'Authenticate.php';
$app = new \Slim\App;
$app->post('/api/authenticate', \Authenticate::class);
$app->run();
.htaccess
RewriteEngine On
RewriteRule ^ index.php [QSA,L]
URL
http://localhost/project/api/authenticate