微信支付公共POST方法（不带证书）

@param url
请求路径
@param key
商户KEY
@param params
参数
@return
11180
@Override
    public NutMap postPay(String url, String key, Map<String, Object> params) {
        params.remove("sign");
        String sign = WxPaySign.createSign(key, params);
        params.put("sign", sign);
        Request req = Request.create(url, METHOD.POST);
        req.setData(Xmls.mapToXml(params));
        Response resp = Sender.create(req).send();
        if (!resp.isOK())
            throw new IllegalStateException("postPay, resp code=" + resp.getStatus());
        return Xmls.xmlToMap(resp.getContent("UTF-8"));
    }
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];
	}
881053
def post(url, params)
      params = convert_hash_keys(params)
      preform(url, :post, params: params) do
        return connection.post(url, params)
      end
    end
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;
    }
550157
public static String post(String url, Map<String, String> bodies) {
        ExceptionUtil.notNull(url);
        return post(url, null, null, null, bodies, false);
    }
932001
@Override
	public <T extends Resource> T post(final String uri, final Parameters params) {
		return doRequest(uri).set(params).post();
	}
797285
public boolean hasValidKey(HttpRequestHeader reqHeader, JSONObject params) {
		try {
			String apiPath;
			try {
				apiPath = reqHeader.getURI().getPath();
			} catch (URIException e) {
				logger.error(e.getMessage(), e);
				return false;
			}
			String nonceParam = reqHeader.getHeader(HttpHeader.X_ZAP_API_NONCE);
			if (nonceParam == null && params.has(API_NONCE_PARAM)) {
				nonceParam = params.getString(API_NONCE_PARAM);
			}
			
			if (nonceParam != null) {
				Nonce nonce = nonces.get(nonceParam);
				if (nonce == null) {
					logger.warn("API nonce " + nonceParam + " not found in request from " + reqHeader.getSenderAddress().getHostAddress());
					return false;
				} else if (nonce.isOneTime()) {
					nonces.remove(nonceParam);
				}
				if (! nonce.isValid()) {
					logger.warn("API nonce " + nonce.getNonceKey() + " expired at " + nonce.getExpires().toString() +
							" in request from " + reqHeader.getSenderAddress().getHostAddress());
					return false;
				}
				
				if (! apiPath.equals(nonce.getApiPath())) {
					logger.warn("API nonce path was " + nonce.getApiPath() + " but call was for " + apiPath + 
						" in request from " + reqHeader.getSenderAddress().getHostAddress());
					return false;
				}
			} else {
				String keyParam = reqHeader.getHeader(HttpHeader.X_ZAP_API_KEY);
				if (keyParam == null && params.has(API_KEY_PARAM)) {
					keyParam = params.getString(API_KEY_PARAM);
				}
				if (!getOptionsParamApi().getKey().equals(keyParam)) {
					logger.warn("API key incorrect or not supplied: " + keyParam +
							" in request from " + reqHeader.getSenderAddress().getHostAddress());
					return false;
				}
			}
			
			return true;
		} finally {
			synchronized (nonces) {
				for (Entry<String, Nonce> entry : nonces.entrySet()) {
					if (! entry.getValue().isValid()) {
						nonces.remove(entry.getKey());
					}
				}
			}
		}
	}
71224
public JSONObject delete(String url, HashMap<String, String> params) throws JSONException {
		return sendPostRequest(url, METHOD_DELETE, params);
	}
80338
public static String post(String url,
                              Map<String, String> header,
                              Map<String, String> params) throws IOException {

        HttpURLConnection httpUrlConn = httpUrlConn(url);
        httpUrlConn.setDoOutput(true);
        httpUrlConn.setRequestMethod(Constant.RequestMethodPost);
        // header
        if (header != null) {
            header(header, httpUrlConn);
        }

        httpUrlConn.connect();

        // out
        if (params != null) {
            PrintWriter pw = new PrintWriter(httpUrlConn.getOutputStream());
            String param = Utils.getUrlParamsByMap(params);
            pw.print(param);
            pw.flush();
            pw.close();
        }

        return readIO(httpUrlConn);
    }
1070528
public String getMessage(String key, Object param)
    {
        return getMessage(key, new Object[]{param});
    }
1080497
public JSONObject post(String path, Map<String, Object> params) throws APIError {
        return request(Verb.POST, path, params);
    }
1090504
public OkRequest<T> param(final String key, final String value) {
        StringBuilder urlBuilder = new StringBuilder(getUrl());
        if (getUrl().contains("?")) {
            urlBuilder.append("&");
        } else {
            urlBuilder.append("?");
        }
        urlBuilder.append(key);
        urlBuilder.append("=");
        urlBuilder.append(value);
        mRequestUrl = urlBuilder.toString();
        return this;
    }
711093
public static String message(String key, Object... params) {
        return message(key, null, params);
    }
1249407
function generateSign(api, params, method, secretKey){

	//将method转为大写
	method = method.toUpperCase();
	if(method !== 'GET' && method !== 'POST'){
		throw new Error('method is invalid');
	}

	if(typeof params !== 'object'){
		throw new Error('params is invalid');
	}

	//提取host和path
	var urlParams = url.parse(api);
	var hostPath  = urlParams.host + urlParams.path;

	//对params里的key进行排序
	var arrKey = [];
	for(var key in params){
		arrKey.push(key);
	}
	arrKey.sort();

	//拼接参数字符串
	var strParams = '';
	for(var i=0; i < arrKey.length; i++){
		var value = params[arrKey[i]];
		strParams += arrKey[i] + '=' + value;
	}

	return md5(method + hostPath + strParams + secretKey);
}
1301137
public static String doGet(String url, Map<String, String> params, String charset) throws IOException {
        HttpURLConnection conn = null;
        String rsp = null;

        try {
            String ctype = "application/x-www-form-urlencoded;charset=" + charset;
            String query = buildQuery(params, charset);
            conn = getConnection(buildGetUrl(url, query), METHOD_GET, ctype, null);

            rsp = getResponseAsString(conn);
        } finally {
            if (conn != null) {
                conn.disconnect();
            }
        }

        return rsp;
    }
932844
public JSONObject get(String url, HashMap<String, String> params) throws JSONException {
		return sendGetRequest(url, METHOD_GET, params);
	}
1269453
protected String buildParamsQuery(final Map<String, String> params)
			throws UnsupportedEncodingException {
		StringBuilder builder = new StringBuilder();
		if (params.isEmpty()) {
			return builder.toString();
		}

		String sep = "";
		for (Map.Entry<String, String> entry : params.entrySet()) {
			builder.append(sep);
			builder.append(urlencode(entry.getKey()));
			builder.append("=");
			builder.append(urlencode(entry.getValue()));
			sep = "&";
		}

		return builder.toString();
	}