From fd03b5ef92db7ad6f38059713d97fa88e30e4aea Mon Sep 17 00:00:00 2001 From: Nyholm Date: Sat, 3 Oct 2020 10:12:27 +0200 Subject: [PATCH] Adding docs about Request::toArray() --- components/http_foundation.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index c4662198bdb..27842974496 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -188,9 +188,16 @@ Finally, the raw data sent with the request body can be accessed using $content = $request->getContent(); -For instance, this may be useful to process a JSON string sent to the +For instance, this may be useful to process a XML string sent to the application by a remote service using the HTTP POST method. +.. versionadded:: 5.2 + + If the request body is a JSON string, it can be accessed using + :method:`Symfony\\Component\\HttpFoundation\\Request::toArray`:: + + $data = $request->toArray(); + Identifying a Request ~~~~~~~~~~~~~~~~~~~~~