Returns a key/value pair string for URL parameter encoding.

@param param The parameter key/value pair.

@return A key/value pair string for URL parameter encoding.
432801
private static String getKeyValuePair(final Pair<String,String> param, 
        final boolean formEncoding)
        {
        try 
            {
            return getKeyValuePair(param.getFirst(), param.getSecond(), 
                formEncoding);
            }
        catch (final Exception e)
            {
            LOG.error("Could not get encoding for: {}", param, e);
            return "unknown=unknown";
            }
        }
1280750
public static String getRequestParameterValue(final HttpServletRequest request, final String key) {
		String[] values = getRequestParameterValues(request, key);
		return values == null || values.length == 0 ? null : values[0];
	}
1155034
public static String getURLString(String methodName,
			Map<String, Object> params) throws MusixMatchException {
		String paramString = new String();

		paramString += methodName + "?";

		for (Map.Entry<String, Object> entry : params.entrySet()) {
			try {
				paramString += entry.getKey()
						+ "="
						+ URLEncoder.encode(entry.getValue().toString(),
								"UTF-8");
			} catch (UnsupportedEncodingException e) {
				throw new MusixMatchException("Problem encoding "
						+ entry.getValue(), e);
			}

			paramString += "&";
		}

		paramString = paramString.substring(0, paramString.length() - 1);

		return paramString;
	}
1250510
public void decodeQueryTo(MultiMap<String> parameters, Charset encoding) throws UnsupportedEncodingException {
        if (_query == null)
            return;

        if (encoding == null || StandardCharsets.UTF_8.equals(encoding))
            UrlEncoded.decodeUtf8To(_query, parameters);
        else
            UrlEncoded.decodeTo(_query, parameters, encoding);
    }
90475
def _encode_params(**kw):
    '''
    
    '''
    args = []
    for k, v in kw.iteritems():
        if isinstance(v, basestring):
            qv = v.encode('utf-8') if isinstance(v, unicode) else v
            args.append('%s=%s' % (k, urllib.quote(qv)))
        elif isinstance(v, collections.Iterable):
            for i in v:
                qv = i.encode('utf-8') if isinstance(i, unicode) else str(i)
                args.append('%s=%s' % (k, urllib.quote(qv)))
        else:
            qv = str(v)
            args.append('%s=%s' % (k, urllib.quote(qv)))
    return '&'.join(args)
501921
public static String stringifyValue(Param param, ObjectMapper mapper) {
		assert !(param instanceof BinaryParam);
		
		if (param.value instanceof String)
			return (String)param.value;
		if (param.value instanceof Date)
			return Long.toString(((Date)param.value).getTime() / 1000);
		else if (param.value instanceof Number)
			return param.value.toString();
		else
			return JSONUtils.toJSON(param.value, mapper);
	}
1345535
public static HashMap<String, String> decodeParamMap(String paramsStr, String charset) {
		final Map<String, List<String>> paramsMap = decodeParams(paramsStr, charset);
		final HashMap<String, String> result = MapUtil.newHashMap(paramsMap.size());
		List<String> valueList;
		for (Entry<String, List<String>> entry : paramsMap.entrySet()) {
			valueList = entry.getValue();
			result.put(entry.getKey(), CollUtil.isEmpty(valueList) ? null : valueList.get(0));
		}
		return result;
	}
144481
def url_param2value(param):
    
    if param == None:
        return Null
    if param == None:
        return Null

    def _decode(v):
        output = []
        i = 0
        while i < len(v):
            c = v[i]
            if c == "%":
                d = hex2chr(v[i + 1:i + 3])
                output.append(d)
                i += 3
            else:
                output.append(c)
                i += 1

        output = text_type("".join(output))
        try:
            return json2value(output)
        except Exception:
            pass
        return output

    query = Data()
    for p in param.split('&'):
        if not p:
            continue
        if p.find("=") == -1:
            k = p
            v = True
        else:
            k, v = p.split("=")
            v = _decode(v)

        u = query.get(k)
        if u is None:
            query[k] = v
        elif is_list(u):
            u += [v]
        else:
            query[k] = [u, v]

    return query
776852
protected static final QueryMap parseApiRequestQueryParams(String queryString) {
        QueryMap rval = new QueryMap();

        if (queryString != null) {
            try {
                String[] pairSplit = queryString.split("&"); //$NON-NLS-1$
                for (String paramPair : pairSplit) {
                    int idx = paramPair.indexOf("="); //$NON-NLS-1$
                    String key, value;
                    if (idx != -1) {
                        key =  URLDecoder.decode(paramPair.substring(0, idx), "UTF-8"); //$NON-NLS-1$
                        value = URLDecoder.decode(paramPair.substring(idx + 1), "UTF-8"); //$NON-NLS-1$
                    } else {
                        key = URLDecoder.decode(paramPair, "UTF-8"); //$NON-NLS-1$
                        value = null;
                    }
                    rval.add(key,  value);
                }
            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e);
            }

        }

        return rval;
    }
108902
function getQueryParameterValue(url, parameterName) {
        var parts;
        var query = (url || '').split('?');
        if (query && query.length > 0) {
            parts = query[1];
        }
        else {
            parts = '';
        }
        var vars = parts.split('&');
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split('=');
            if (decodeURIComponent(pair[0]) == parameterName) {
                return decodeURIComponent(pair[1]);
            }
        }
        // not found
        return null;
    }
660187
protected String encode(String param) throws Exception {
    String result = URLEncoder.encode(param, "UTF-8");
    return result;
  }
140052
public static Map<String, String> getUrlParams(String param) {
        Map<String, String> map = new HashMap<String, String>();
        if (StringUtils.isEmpty(param)) {
            return map;
        }
        String[] params = param.split("&");
        for (int i = 0; i < params.length; i++) {
            String[] p = params[i].split("=");
            if (p.length == 2) {
                map.put(p[0], p[1]);
            }
        }
        return map;
    }
55829
private static Object getParam(final Object param) {
		final StringBuilder sb = new StringBuilder();
		if(param instanceof String){
			sb.append("'");
			sb.append((String)param);
			sb.append("'");
		}
		else if(param instanceof Boolean){
			sb.append(String.valueOf((Boolean)param));			
		}
        else if(param instanceof Integer){
            sb.append(String.valueOf((Integer)param));
        }
        else if(param instanceof DBRegExp){
            sb.append('/');
            sb.append(((DBRegExp) param).toString());
            sb.append('/');
        }
		
		return sb.toString();
	}
1153413
public static String buildParam(String paramName, List<String> paramArgs)
      throws IOException {
    StringBuilder sb = new StringBuilder();
    for (String arg : paramArgs) {
      if (sb.length() > 0) {
        sb.append("&");
      }
      sb.append(paramName).append("=").append(URLEncoder.encode(arg, "UTF-8"));
    }
    return sb.toString();
  }
344662
private String getParameter(String paramKey, String defaultValue) {
        String paramValue = defaultValue;
        if (StringUtils.isNotBlank(paramKey) && args != null && args.length > 0) {
            for (String arg : args) {
                String[] parameter = arg.split("=");
                if (parameter != null && parameter.length == 2 && paramKey.equals(parameter[0])) {
                    paramValue = parameter[1];
                    break;
                }
            }
        }
        return paramValue;
    }
1074439
public static String formatParamList(String ... params) {
		StringBuilder s = new StringBuilder();
		for(String p : params) {
			if (s.length() != 0) {
				s.append(", ");
			}
			s.append(p);
		}
		return s.toString();
	}
727248
public java.util.Collection<String> getParam(String paramName) {
        return this.params.get(paramName);
    }