Hellow!
I’m using Slim4 for simple RestAPI (/api/app.php & /api/routes.php & some Actions classes).
Now it has become necessary to make v2 fore some routes (other mast be redirected to v1). And here the problem starts
redirect() answer: 405 NOT ALLOWED
May be problem with grouping?
$app->group('/v1', function (Group $group) {
$group->group('/user', function (Group $group) {
$group->post('/register', RegisterAction::class)->setName('register');
$group->post('/authorize', AuthorizeAction::class)->setName('authorize');
$group->post('/current', CurrentAction::class)->setName('current');
....
});
....
});
$app->group('/v2', function (Group $group) {
$group->redirect('/user/current', '/api/v1/user/current', 302);
...
});
GET /api/v2/links - work correctly
POST /api/v2/user/current - 405 NOT ALLOWED
GET /api/v2/group - work correctly
GET /api/v2/group/section/15 - return org.apache.http.client.ClientProtocolException (problem in {id} I think)