From 504e41f39d2fc66b808b579bbec1db9a8f740ba8 Mon Sep 17 00:00:00 2001 From: The Devick <71853418+TheDevick@users.noreply.github.com> Date: Tue, 5 Jul 2022 20:13:58 -0300 Subject: [PATCH] Update http_foundation.rst --- components/http_foundation.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 8780745738c..4c2f31b989b 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -206,6 +206,15 @@ If the request body is a JSON string, it can be accessed using .. versionadded:: 5.2 The ``toArray()`` method was introduced in Symfony 5.2. + +If the request body is a JSON string, can be accessed as Object using +:method:`Symfony\\Component\\HttpFoundation\\Request::toObject`:: + + $data = $request->toObject(); + +.. versionadded:: 6.1 + + The ``toObject()`` method was introduced in Symfony 6.1. Identifying a Request ~~~~~~~~~~~~~~~~~~~~~