title: How can I receive a JSON in symfony2
body: <p>I'm currently working on a symfony2 based project with lots of ajax usage.</p>
  
  <p>Now I want to send a JSON via <code>$.ajax();</code> (POST type) and handle it in a symfony2 controller.
  But I'm not quite sure how I access the JSON inside the controller.</p>
  
  <p>Right now I've got the following:</p>
  
  <p>JS:</p>
  
  <pre><code>            $.ajax({
                  url: url,
                  type:"POST",
                  data:json,
                  success:function (data) {
                      $('div.tooltip p').html(data);
                  }
              });
  </code></pre>
  
  <p>And the PHP:</p>
  
  <pre><code>    public function registrationAction(Request $request) {
          if($request-&gt;getMethod() == 'POST') {
              // How to receive??
          }
  
          return $this-&gt;render('KnowHowERegistrationBackendBundle:Create:registration.html.twig');
  }
  </code></pre>
  
  <p>The only thing I don't know is how can I access the JSON?
  I'm sure it's pretty easy I just don't see it.
  Thanks for your help!</p>