Laravel 5 POST routes to index instead of store

后端 未结 2 533
难免孤独
难免孤独 2021-01-02 14:19

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\         


        
2条回答
  •  情深已故
    2021-01-02 14:28

    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.

提交回复
热议问题