Is this missing from your config?
[‘class’ => ‘yii\rest\UrlRule’, ‘controller’ => ‘api/unit’], don`t work
If anyone hits same issue make sure that you have request enabled to handle JSON
'request' => [ 'parsers' => [ 'application/json' => 'yii\web\JsonParser', ] ]
It seems you can not do a delete when you don’t have a token set in the rules. For some reason the delete method is then not allowed.