How to get $_POST and $_GET parameters
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');