private function buildQuery($parts)
    {
        $return = array();
        foreach ($parts as $key => $value) {
            if (is_array($value)) {
                foreach ($value as $v) {
                    $return[] = urlencode($key) . "=" . urlencode($v);
                }
                continue;
            }
            $return[] = urlencode($key) . "=" . urlencode($value);
        }
        return implode('&', $return);
    }