protected function addParameters()
    {
        if (empty($this->params)) {
            return $this;
        }

        $params = http_build_query($this->params);
        if ($this->options[CURLOPT_POST]) {
            $this->options[CURLOPT_POSTFIELDS] = $params;
            return $this;
        }

        //if there is a question mark in the url
        if (strpos($this->options[CURLOPT_URL], '?') === false) {
            //add the question mark
            $params = '?'.$params;
        //else if the question mark is not at the end
        } else if (substr($this->options[CURLOPT_URL], -1, 1) != '?') {
            //append the parameters to the end
            //with the other parameters
            $params = '&'.$params;
        }

        //append the parameters
        $this->options[CURLOPT_URL] .= $params;

        return $this;
    }