Get information on the current request

Get information on the current request in Drupal 8.

<?php
// The Request object can be obtained by statically calling the request method on \Drupal
$request = \Drupal::request();

$scheme = $request->getScheme(); // http
$host = $request->getHttpHost(); // mywebsite.com:8080
$requestUri = $request->getRequestUri(); // path/to/file?a=1&b=2
$sessionId = $request->getSession()->getId();

// More...