protected function convertArrayToHeaderString(array $data) {
        $strings = [];
        foreach ($data as $key => $val) {
            if (null === $val) {
                $strings[] = $key;
                continue;
            }
            if (is_bool($val)) {
                $val = !empty($val) ? 1 : 0;
            }
            $strings[] = $key . '=' . $val;
        }
        return implode('; ', $strings);
    }