Skip to content

Commit fd03b5e

Browse files
committed
Adding docs about Request::toArray()
1 parent b86e003 commit fd03b5e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

components/http_foundation.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,16 @@ Finally, the raw data sent with the request body can be accessed using
188188

189189
$content = $request->getContent();
190190

191-
For instance, this may be useful to process a JSON string sent to the
191+
For instance, this may be useful to process a XML string sent to the
192192
application by a remote service using the HTTP POST method.
193193

194+
.. versionadded:: 5.2
195+
196+
If the request body is a JSON string, it can be accessed using
197+
:method:`Symfony\\Component\\HttpFoundation\\Request::toArray`::
198+
199+
$data = $request->toArray();
200+
194201
Identifying a Request
195202
~~~~~~~~~~~~~~~~~~~~~
196203

0 commit comments

Comments
 (0)