请求地址的简单方法

    payUrl= paymentUrl+"?";
    Set entrySet = paramMap.entrySet();
    Iterator it = entrySet.iterator();
    while (it.hasNext()) {
     Map.Entry me = (Map.Entry) it.next();
     String key = (String) me.getKey();
     String value = (String) me.getValue();
     System.out.println("传输的键值对为: key:" + key + ", value:" + value);
     payUrl=payUrl+key+"="+value+"&";
    }

    // 去掉最后一个&
    payUrl = payUrl.substring(0, payUrl.length() - 1);
    System.out.println("传输的总字段: " + payUrl);

你可能感兴趣的:(请求地址的简单方法)