Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f4b319

Browse files
committed
featuresymfony#3610 [HttpFoundation] Add doc for Request::getContent() method (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 |symfony#3609Commits-------a61c137 [HttpFoundation] Add doc for Request::getContent() method
2 parents56bc266 +a61c137 commit3f4b319

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎components/http_foundation/introduction.rst‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,22 @@ argument::
168168

169169
.. _component-foundation-attributes:
170170

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

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+
179187
Identifying a Request
180188
~~~~~~~~~~~~~~~~~~~~~
181189

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp