Android Map to URL Convert getUrlParamsByMap(Map map)

Here you can find the source of getUrlParamsByMap(Map map)

Description

get Url Params By Map

Declaration

public static String getUrlParamsByMap(Map<String, Object> map) 

Method Source Code

//package com.java2s;
import java.util.Map;

public class Main {

    public static String getUrlParamsByMap(Map<String, Object> map) {
        if (map == null) {
            return "";
        }//from   w w w . j  a v a 2s. c  o  m
        StringBuffer sb = new StringBuffer();
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            sb.append(entry.getKey() + "=" + entry.getValue());
            sb.append("&");
        }
        return sb.toString();
    }
}