I spent a lot of time trying to figure out why my routes were not working and found that I needed to exclude the trailing forward slash. Not sure if this is done intentional but just wanted to bring this up in case someone else encounters this issue.
Routes:
Example:
POST http://localhost/API/news/ will send you to the GET (http://localhost/API/news/view) route
POST http://localhost/API/news will work correctly
Even if I set my route with the trailing forward slash I still get routed to API\news::view. Any insight on this behavior appreciated.
Thanks in advance
Routes:
PHP Code:
$routes->post('API/news', 'API\News::create');
$routes->get('API/news', 'API\News::view');
Example:
POST http://localhost/API/news/ will send you to the GET (http://localhost/API/news/view) route
POST http://localhost/API/news will work correctly
Even if I set my route with the trailing forward slash I still get routed to API\news::view. Any insight on this behavior appreciated.
Thanks in advance