summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangwei <[email protected]>2023-11-03 20:59:07 +0800
committerwangwei <[email protected]>2023-11-03 20:59:07 +0800
commitc58de2f31a9b6d292aebae83a7c9ccdc16335bda (patch)
tree854f224a52de66a32d6f798ed8d7e386463917a9
parent2c1404e67d6777516ee8dc2f268a205e3329eb93 (diff)
修正构建QUery ID为HTTP POST23.11.03
-rw-r--r--src/main/java/com/mesa/reportservice/service/impl/ClickhouseServiceImpl.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/com/mesa/reportservice/service/impl/ClickhouseServiceImpl.java b/src/main/java/com/mesa/reportservice/service/impl/ClickhouseServiceImpl.java
index 13eeb38..7289412 100644
--- a/src/main/java/com/mesa/reportservice/service/impl/ClickhouseServiceImpl.java
+++ b/src/main/java/com/mesa/reportservice/service/impl/ClickhouseServiceImpl.java
@@ -11,6 +11,7 @@ import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -55,12 +56,10 @@ public class ClickhouseServiceImpl implements ClickhouseService {
String sql = null;
sql = URLEncoder.encode(query, "utf8").replaceAll("\\+", "%20");
url = url + sql;
- HttpGet httpGet = new HttpGet(url);
+ HttpPost httpPost = new HttpPost(url);
// 加入配置信息
- httpGet.setConfig(RequestshortConfig);
-
-
- response = this.httpClient.execute(httpGet);
+ httpPost.setConfig(RequestshortConfig);
+ response = this.httpClient.execute(httpPost);
if (response.getStatusLine().getStatusCode() != 200) {
throw new IOException();
} else {