Permalink
Browse files

feature #3610 [HttpFoundation] Add doc for Request::getContent() meth…

…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 3f4b319f65f30ada4a57ad243072824d325e7f52
Showing with 10 additions and 2 deletions.
  1. +10 −2 components/http_foundation/introduction.rst
@@ -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
~~~~~~~~~~~~~~~~~~~~~

0 comments on commit 3f4b319

Please sign in to comment.