Skip to content

Commit

Permalink
feature #3610 [HttpFoundation] Add doc for Request::getContent() meth…
Browse files Browse the repository at this point in the history
…od (bicpi)

This PR was merged into the 2.3 branch.

Discussion
----------

[HttpFoundation] Add doc for Request::getContent() method

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | all
| Fixed tickets | #3609

Commits
-------

a61c137 [HttpFoundation] Add doc for Request::getContent() method
  • Loading branch information
weaverryan committed Mar 9, 2014
2 parents 56bc266 + a61c137 commit 3f4b319
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,22 @@ argument::

.. _component-foundation-attributes:

Finally, you can also store additional data in the request,
thanks to the public ``attributes`` property, which is also an instance of
Thanks to the public ``attributes`` property, you can store additional data
in the request, which is also an instance of
:class:`Symfony\\Component\\HttpFoundation\\ParameterBag`. This is mostly used
to attach information that belongs to the Request and that needs to be
accessed from many different points in your application. For information
on how this is used in the Symfony2 framework, see
:ref:`the Symfony2 book <book-fundamentals-attributes>`.

Finally, the raw data sent with the request body can be accessed using
:method:`Symfony\\Component\\HttpFoundation\\Request::getContent()`::

$content = $request->getContent();

For instance, this may be useful to process a JSON string sent to the
application by a remote service using the HTTP POST method.

Identifying a Request
~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 3f4b319

Please sign in to comment.