提交 667d4868 编写于 作者: 许雪里's avatar 许雪里

httpclient防止重复提交

上级 837ab404
......@@ -30,7 +30,9 @@ public class HttpClientUtil {
byte[] responseBytes = null;
HttpPost httpPost = new HttpPost(reqURL);
CloseableHttpClient httpClient = HttpClients.createDefault();
//CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpClient httpClient = HttpClients.custom().disableAutomaticRetries().build(); // disable retry
try {
// init post
/*if (params != null && !params.isEmpty()) {
......@@ -62,7 +64,7 @@ public class HttpClientUtil {
EntityUtils.consume(entity);
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
logger.error("", e);
throw e;
} finally {
httpPost.releaseConnection();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册