From a61c1376af830d03ea33389cdee4004029cf1957 Mon Sep 17 00:00:00 2001
From: Philipp Rieber
Date: Wed, 26 Feb 2014 15:19:23 +0100
Subject: [PATCH] [HttpFoundation] Add doc for Request::getContent() method
---
components/http_foundation/introduction.rst | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst
index a93ce40eb58..1e949d356a7 100644
--- a/components/http_foundation/introduction.rst
+++ b/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 `.
+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
~~~~~~~~~~~~~~~~~~~~~