Fix http client error
This commit is contained in:
parent
fb8cf7d3b6
commit
6ae100e390
@ -69,7 +69,7 @@ public class HttpClient {
|
|||||||
HttpURLConnection conn = null;
|
HttpURLConnection conn = null;
|
||||||
try {
|
try {
|
||||||
String encodedContent = encodingParams(paramValues, encoding);
|
String encodedContent = encodingParams(paramValues, encoding);
|
||||||
url += (null == encodedContent) ? "" : ("?" + encodedContent);
|
url += (StringUtils.isEmpty(encodedContent)) ? "" : ("?" + encodedContent);
|
||||||
|
|
||||||
conn = (HttpURLConnection) new URL(url).openConnection();
|
conn = (HttpURLConnection) new URL(url).openConnection();
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ public class HttpClient {
|
|||||||
private static String encodingParams(Map<String, String> params, String encoding)
|
private static String encodingParams(Map<String, String> params, String encoding)
|
||||||
throws UnsupportedEncodingException {
|
throws UnsupportedEncodingException {
|
||||||
if (null == params || params.isEmpty()) {
|
if (null == params || params.isEmpty()) {
|
||||||
return null;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
params.put("encoding", encoding);
|
params.put("encoding", encoding);
|
||||||
|
Loading…
Reference in New Issue
Block a user