Issues regarding DELETE method

Hello!

im having issues on ubuntu 19.04 while trying to use the delete method:

$app->delete(’/hotels/’, function ($request, $response, $args) {
die(var_dump($args));
});

i get the infamous ->
Method not allowed. Must be one of: GET, PUT, POST

hen i test it with postman using the DELETE method,

tried changing the apache2.conf with no luck, the message is still there.
any help would be appreciated.

thanks in advance.

Hi @alfredogon82

The DELETE method works. I have testet it with postman.

Try to remove the last / from the route:

$app->delete('/hotels', function ($request, $response, $args) {
    var_dump($args);
});

THANKS!

it works now perfectly :slight_smile:

1 Like