rakibtg rakibtg - 1 month ago 14
reST (reStructuredText) Question

No body data found in Laravel 5.3 with PUT request

Here is my route to update the contacts.

Route::put( 'contact-type/{id}', 'ContactTypeController@update' );


Here is the controller to test if the request was there with the PUT request.

public function update(Request $request, $id)
{
return response()->json([ 'id' => $id, 'req' => $request->all() ]);
}


When i send a request using postman, the request is null!

enter image description here

Is the body payload is not allowed in laravel PUT requests? Or how we send additional data in a PUT request?

Answer

ahw just change from form-data to x-www-form-urlencoded

Screen Shot

Comments