|
@@ -107,7 +107,12 @@ public class HttpUtil { |
|
|
public static SwMap post(String url, Map<String, String> paras) throws Exception { |
|
|
public static SwMap post(String url, Map<String, String> paras) throws Exception { |
|
|
String json_resp = post(url, null, paras, null); |
|
|
String json_resp = post(url, null, paras, null); |
|
|
if (StringUtils.isEmpty(json_resp) || !json_resp.startsWith("{")) return null; |
|
|
if (StringUtils.isEmpty(json_resp) || !json_resp.startsWith("{")) return null; |
|
|
return (SwMap) JsonUtil.parseMap(json_resp); |
|
|
|
|
|
|
|
|
SwMap swMap = new SwMap(); |
|
|
|
|
|
Map map = JsonUtil.parseMap(json_resp); |
|
|
|
|
|
if(map!=null){ |
|
|
|
|
|
swMap.putAll(map); |
|
|
|
|
|
} |
|
|
|
|
|
return swMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -147,7 +152,12 @@ public class HttpUtil { |
|
|
json_resp = new String(Base64.decodeBase64(json_resp), charset); |
|
|
json_resp = new String(Base64.decodeBase64(json_resp), charset); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isEmpty(json_resp) || !json_resp.startsWith("{")) return null; |
|
|
if (StringUtils.isEmpty(json_resp) || !json_resp.startsWith("{")) return null; |
|
|
return (SwMap) JsonUtil.parseMap(json_resp); |
|
|
|
|
|
|
|
|
SwMap swMap = new SwMap(); |
|
|
|
|
|
Map map = JsonUtil.parseMap(json_resp); |
|
|
|
|
|
if(map!=null){ |
|
|
|
|
|
swMap.putAll(map); |
|
|
|
|
|
} |
|
|
|
|
|
return swMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -169,14 +179,24 @@ public class HttpUtil { |
|
|
json_resp = new String(Base64.decodeBase64(json_resp), charset); |
|
|
json_resp = new String(Base64.decodeBase64(json_resp), charset); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isEmpty(json_resp) || !json_resp.startsWith("{")) return null; |
|
|
if (StringUtils.isEmpty(json_resp) || !json_resp.startsWith("{")) return null; |
|
|
return (SwMap) JsonUtil.parseMap(json_resp); |
|
|
|
|
|
|
|
|
SwMap swMap = new SwMap(); |
|
|
|
|
|
Map map = JsonUtil.parseMap(json_resp); |
|
|
|
|
|
if(map!=null){ |
|
|
|
|
|
swMap.putAll(map); |
|
|
|
|
|
} |
|
|
|
|
|
return swMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static SwMap post(String url, Map<String, String> header, Map<String, String> paras) throws Exception { |
|
|
public static SwMap post(String url, Map<String, String> header, Map<String, String> paras) throws Exception { |
|
|
String json_resp = post(url, header, paras, null); |
|
|
String json_resp = post(url, header, paras, null); |
|
|
if (StringUtils.isEmpty(json_resp) || !json_resp.startsWith("{")) return null; |
|
|
if (StringUtils.isEmpty(json_resp) || !json_resp.startsWith("{")) return null; |
|
|
return (SwMap) JsonUtil.parseMap(json_resp); |
|
|
|
|
|
|
|
|
SwMap swMap = new SwMap(); |
|
|
|
|
|
Map map = JsonUtil.parseMap(json_resp); |
|
|
|
|
|
if(map!=null){ |
|
|
|
|
|
swMap.putAll(map); |
|
|
|
|
|
} |
|
|
|
|
|
return swMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|