public static function queryString($params, $parent = null, $callback = 'rawurlencode', $ignoreNonValues = true)
    {
        $params = self::flattenRequestVars($params, $parent);
        $ret = [];
        foreach ($params as $pair) {
            list($name, $value) = $pair;
            if (!$value && $ignoreNonValues) {
                continue;
            }
            if ($callback) {
                $value = call_user_func($callback, $value);
            }
            $ret[] = sprintf('%s=%s', $name, $value);
        }
        return implode('&', $ret);
    }