我尝试了几乎所有东西,但是我一直在接受
不允许的方法。必须是以下之一: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]
非常感谢
您是否尝试过类似的方法:
$app->map(['GET', 'POST'],'/ticket/new', function (Request $request, Response $response) {
// Create new book
echo 'a;';
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句