I am working on a Laravel 5 RESTful API that seems not to be routing the POST requests correctly.
This is my routes.php:
Route::group(array(\'prefix\
The problem was caused by a trailing /
being added to the URL. So, instead of using this URL:
mydomain.com/api/v1/messages/
I tried with this one:
mydomain.com/api/v1/messages
and it worked.
I discovered it by taking a look at the server's log. That is how I discovered that POST requests to the URL messages/
were redirected.
if you are still having this problem and the route is using FormRequest
check if there a authorize
function in it because it will redirect if it returns false