private function addUrlData($url, array $data) {
        // Do nothing, if there is no url data
        if (empty($data)) {
            return $url;
        }

        if (strpos($url, '?') !== false) {
            throw new \InvalidArgumentException();
        }

        $parts[] = trim($url, '/');
        foreach ($data as $key => $value) {
            if ($value) {
                $parts[] = urlencode($key) .'/' . urlencode($value);
            } else {
                $parts[] = urlencode($key);
            }
        }
        return implode('/', $parts);
    }