File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
components/http_foundation Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -168,14 +168,22 @@ argument::
168
168
169
169
.. _component-foundation-attributes :
170
170
171
- Finally , you can also store additional data in the request,
172
- thanks to the public `` attributes `` property , which is also an instance of
171
+ Thanks to the public `` attributes `` property , you can store additional data
172
+ in the request , which is also an instance of
173
173
:class: `Symfony\\ Component\\ HttpFoundation\\ ParameterBag `. This is mostly used
174
174
to attach information that belongs to the Request and that needs to be
175
175
accessed from many different points in your application. For information
176
176
on how this is used in the Symfony2 framework, see
177
177
:ref: `the Symfony2 book <book-fundamentals-attributes >`.
178
178
179
+ Finally, the raw data sent with the request body can be accessed using
180
+ :method: `Symfony\\ Component\\ HttpFoundation\\ Request::getContent() `::
181
+
182
+ $content = $request->getContent();
183
+
184
+ For instance, this may be useful to process a JSON string sent to the
185
+ application by a remote service using the HTTP POST method.
186
+
179
187
Identifying a Request
180
188
~~~~~~~~~~~~~~~~~~~~~
181
189
You can’t perform that action at this time.
0 commit comments