How does Laravel handle PUT requests from browsers?

后端 未结 6 1398
Happy的楠姐
Happy的楠姐 2020-12-20 12:17

I know browsers only support POST and GET requests, and Laravel supports PUT requests using the following code:



        
6条回答
  •  暖寄归人
    2020-12-20 12:41

    in reality there is no PUT request ! its POST request ! when you tell laravel ; hey laravel this is a PUT request ! it means you want to update some resource ! {{Form::open('user/profile', 'PUT')}} the above line means its PUT request (just it means updating a resource as I mentioned before there is no PUT request ) that line of code create a hidden filed in form that specify the type of request and when laravel router get the request it search for PUT handler of the URI for example sth like : Route::put('the/url/you/mention/here/' , 'someController@someAction');

提交回复
热议问题