Skip to content

Commit 5a1d507

Browse files
committed
feature #14325 Adding docs about Request::toArray() (Nyholm)
This PR was merged into the master branch. Discussion ---------- Adding docs about Request::toArray() This will fix #14323. The related PR is found here: symfony/symfony#38224 Commits ------- fd03b5e Adding docs about Request::toArray()
2 parents b86e003 + fd03b5e commit 5a1d507

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)