How to get $_POST and $_GET parameters I ajaxly call a route and pass data to it, In my controller, I want to get $_POST['var'] , $_POST['var2'], it seems because of using HttpFoundation in drupal 8, $_POST and $_GET are not exists in old method, How I can access $_POST parameters in custom Controller?
From the change record:

$name = $_POST['name']; // form param


becomes

$name = \Drupal::request()-&gt;request-&gt;get('name'); // form param


Incidentally, for GET vars, you would use:

$query = \Drupal::request()-&gt;query-&gt;get('name');