If the request data is $_POST data or a JSON string, you can use the getPayload() method which returns an instance of InputBag wrapping this data:

$data = $request->getPayload();

https://symfony.com/blog/new-in-symfony-6-3-request-payload
// Example 1:
// the request has some POST data
// (e.g. `foo: bar` sent as `application/x-www-form-urlencoded`)
$request->getPayload()->all();
// returns the PHP array: ['foo' => 'bar']

// Example 2:
// the request has body contents as some JSON-encoded data
// (e.g. `{"foo": "bar"}`)
$request->getPayload()->all();
// returns the JSON-decoded data as a PHP array: ['foo' => 'bar']
This site uses cookies.