public function setQuery($query, $ensure_encoding = true)
    {
        if (is_string($query) && $ensure_encoding) {
            $query_args = array();
            parse_str($query, $query_args);
            $query = $this->buildQueryString($query_args);
        }
        $this->config['query'] = $query;
        return $this;
    }