Most of the cases like getting query string or form parameters are covered in answers above.
When working with raw data, like a raw JSON string in the body that you would like to give as an argument to json_decode()
, the method Request::getContent()
can be used.
$content = $request->getContent();
Additional useful informations on HTTP requests in Symfony can be found on the HttpFoundation package's documentation.