private function updateHttpHeader()
    {
        $this->_httpHeader = HttpHelper::EOL;

        $endpoint = $this->_options->getCurrentEndpoint();
        if (Endpoint::getType($endpoint) !== Endpoint::TYPE_UNIX) {
            $this->_httpHeader .= sprintf('Host: %s%s', Endpoint::getHost($endpoint), HttpHelper::EOL);
        }

        if (isset($this->_options[ConnectionOptions::OPTION_AUTH_TYPE], $this->_options[ConnectionOptions::OPTION_AUTH_USER])) {
            // add authorization header
            $authorizationValue = base64_encode(
                $this->_options[ConnectionOptions::OPTION_AUTH_USER] . ':' .
                $this->_options[ConnectionOptions::OPTION_AUTH_PASSWD]
            );

            $this->_httpHeader .= sprintf(
                'Authorization: %s %s%s',
                $this->_options[ConnectionOptions::OPTION_AUTH_TYPE],
                $authorizationValue,
                HttpHelper::EOL
            );
        }

        if (isset($this->_options[ConnectionOptions::OPTION_CONNECTION])) {
            // add connection header
            $this->_httpHeader .= sprintf('Connection: %s%s', $this->_options[ConnectionOptions::OPTION_CONNECTION], HttpHelper::EOL);
        }

        if ($this->_database === '') {
            $this->_baseUrl = '/_db/_system';
        } else {
            $this->_baseUrl = '/_db/' . urlencode($this->_database);
        }
    }