Slim Framework Method not allowed. Must be one of: POST (405)

Viewed 14273

I have written REST api in slim framework. When i call authenticate API from browser it troughs 'Method not allowed. Must be one of: POST'. Below is my code, please correct me where i went wrong.

Index.php

<?php

require 'vendor/autoload.php';
require 'Authenticate.php';

$app = new \Slim\App;

$app->post('/api/authenticate', \Authenticate::class);

$app->run();

.htaccess

RewriteEngine On
RewriteRule ^ index.php [QSA,L]

URL

http://localhost/project/api/authenticate
1 Answers
Related