public function getHeaders($names = null) {
        if     (!isset($names))    $names = [];
        elseif (is_string($names)) $names = [$names];
        elseif (is_array($names)) {
            foreach ($names as $i => $name) {
                if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $names['.$i.']: '.gettype($name));
            }
        }
        else                           throw new IllegalTypeException('Illegal type of parameter $names: '.gettype($names));

        // without a name return all headers
        if (!$names) {
            return $this->headers;
        }
        return \array_intersect_ukey($this->headers, \array_flip($names), 'strCaseCmp');
    }