/**
* MAP类型数组转换成NameValuePair类型
* @param map MAP类型数组
* @return NameValuePair类型数组
*/
private static NameValuePair[] generatNameValuePair(Map<String, String> map,String charset) throws Exception {
NameValuePair[] nameValuePair = new NameValuePair[map.size()];
int i = 0;
for (Map.Entry<String, String> entry : map.entrySet()) {
nameValuePair[i++] = new NameValuePair(entry.getKey(), URLEncoder.encode(entry.getValue(), charset));
}
return nameValuePair;
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。