public function getPath($uri, array $params, $withQuery = true)
    {
        $cleanUrl = trim($this->getBaseUrl(), "/ ");
        $cleanUri = trim($uri, "/ ");

        if ($withQuery === false || empty($params))
            return sprintf("%s/%s", $this->getBaseUrl(), $cleanUri);

        // build HTTP query for GET request
        $query = http_build_query($params);
        return sprintf("/%s/%s?%s", $cleanUrl, $cleanUri, $query);
    }