So curious about this... having the same trouble using curl to send PATCH requests -- form data doesn't make it through.
PATCH requests with 'form-data' parameters are not recognized
Working on a restful API and I'm stuck on this weird issue when trying to update a user.
The resource controller is defined as follows:
Route::resource('users', 'Api\UsersController');
The patch URI looks like:
/api/users/{id}
The corresponding method looks as follows:
public function update(Request $request, $id)
{
dd($request->all()); //Always empty array, why?
...
}
So then tried in POSTman to send the same patch request. In POSTman you can send parameters in the body as type form-data or x-www-form-urlencoded. When using form-data, request->all() is always empty. The params send via x-www-form-urlencoded are sent correctly.
There is also a way to pass params with the button next to the URL in POSTman. This works as well. I do need to send them as form-data, because the patch request has to send a file along.
Does anyone know why the Laravel Request object is empty? And also what the difference is between those 3 types of parameters in POSTman?
Frank
Please or to participate in this conversation.