protected function createFromGlobals() {
    if(php_sapi_name() === 'cli') {
      throw new InvalidStateException('Requests can not be instantiated from globals in CLI mode');
    }
    
    $method  = HttpMethod::memberByKey($_SERVER['REQUEST_METHOD'], false);
    $uri     = strtok($_SERVER['REQUEST_URI'], '?');
    $host    = $_SERVER['HTTP_HOST'];
    $headers = getallheaders();
    
    $this->create($method, $uri, $host, $headers, $_COOKIE, $_GET, $_POST);
  }