trailing slash misdirects resource controller |
when specifying a resource route according to the user guide:
PHP Code: $routes->resource('photos'); adding a route like PHP Code: $routes->post('users/', 'Users::create');
This is because a URL ending with a trailing slash is treated as a directory, not a file.
This applies to all URLs in general, not only in API or CodeIgniter as a whole. https://en.ryte.com/wiki/Trailing_Slashe...20a%20file.
sorry, I don't see how it makes a POST request to /photos/ equivalent to a GET request to /photos in a REST resource. Seems like now I need to manually add a check if index() has been called with the incorrect method and return 404
|
Welcome Guest, Not a member yet? Register Sign In |