Q:

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

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

A:

if you type the URL in the browser, the method is going to be GET instead of POST. What you can do is use Postman or other alternatives of your choice to test your REST API for other methods like POST, PUT, DELETE, etc.
More info about HTTP methods here
Hope it helps!

