我几乎尝试了一切 但我一直在接受
不允许使用方法。必须是以下之一: 的 POST
我正在使用的代码是:
$app->post('/ticket/new', function (Request $request, Response $response) {
// Create new book
echo 'a;';
});
我正在尝试邮递员
method: post
url: /public/ticket/new
header: Content-Type application/javascript
任何线索都会对我有所帮助
.htaccess
没问题:
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
非常感谢
答案 0 :(得分:0)
你有没有试过像:
$app->map(['GET', 'POST'],'/ticket/new', function (Request $request, Response $response) {
// Create new book
echo 'a;';
});