Skip to content

Commit

Permalink
feature #14325 Adding docs about Request::toArray() (Nyholm)
Browse files Browse the repository at this point in the history
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()
  • Loading branch information
wouterj committed Oct 3, 2020
2 parents b86e003 + fd03b5e commit 5a1d507
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/http_foundation.rst
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 5a1d507

Please sign in to comment.