title: Symfony 3 csrf token
body: <p>How can I get or set the csrf_token with symfony?
  here my code and I don't know how can I do with csrf_token,</p>
  
  <pre><code>$username = $request-&gt;request-&gt;get('username');
  $password = $request-&gt;request-&gt;get('password');
  
      if($request-&gt;isMethod('POST')){
          $headers = array('Accept' =&gt; 'application/json');
          $query = array('email' =&gt; $username, 'mdp' =&gt; $password);
  
          $url = ' /**/ ';
          $body = Unirest\Request\Body::json($query);
  
          $response = Unirest\Request::post('$url',$headers,$body);
  
          return new Response(json_encode($response));
  
      }
  
      return $this-&gt;render('AppBundle:Default:index.html.twig');
  </code></pre>
  
  <p>Thanks!</p>