|
|
@@ -67,7 +67,6 @@ public class HttpUtil {
|
|
67
|
67
|
CloseableHttpClient httpClient = null;
|
|
68
|
68
|
try{
|
|
69
|
69
|
httpPost = new HttpPost(reqURL);
|
|
70
|
|
- httpClient = HttpClients.createDefault();
|
|
71
|
70
|
if (params != null && !params.isEmpty()) {
|
|
72
|
71
|
List<NameValuePair> formParams = new ArrayList<NameValuePair>();
|
|
73
|
72
|
for(Map.Entry<String,String> entry : params.entrySet()){
|
|
|
@@ -78,6 +77,9 @@ public class HttpUtil {
|
|
78
|
77
|
RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(5000).setConnectTimeout(5000).build();
|
|
79
|
78
|
httpPost.setConfig(requestConfig);
|
|
80
|
79
|
|
|
|
80
|
+ //httpClient = HttpClients.createDefault(); // default retry 3 times
|
|
|
81
|
+ httpClient = HttpClients.custom().disableAutomaticRetries().build();
|
|
|
82
|
+
|
|
81
|
83
|
HttpResponse response = httpClient.execute(httpPost);
|
|
82
|
84
|
HttpEntity entity = response.getEntity();
|
|
83
|
85
|
if (response.getStatusLine().getStatusCode() == 200) {
|