You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/07/26 01:06:03 UTC
[GitHub] [inlong] healchow commented on a diff in pull request #5198: [INLONG-5197][Manager] Unify the HTTP request method of the OpenAPI query interface from GET to POST
healchow commented on code in PR #5198:
URL: https://github.com/apache/inlong/pull/5198#discussion_r929436863
##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/RemoteConfigManager.java:
##########
@@ -182,20 +183,25 @@ private void setReloadTimer() {
* reloadDataProxyConfig
*/
private boolean reloadDataProxyConfig(String clusterName, String clusterTag, String host) {
- HttpGet httpGet = null;
+ HttpPost httpPost = null;
try {
- String url = "http://" + host + ConfigConstants.MANAGER_PATH + ConfigConstants.MANAGER_GET_ALL_CONFIG_PATH
- + "?clusterName=" + clusterName + "&clusterTag=" + clusterTag;
+ String url = "http://" + host + ConfigConstants.MANAGER_PATH + ConfigConstants.MANAGER_GET_ALL_CONFIG_PATH;
+ httpPost = new HttpPost(url);
+ httpPost.addHeader(HttpHeaders.CONNECTION, "close");
+ httpPost.addHeader(HttpHeaders.AUTHORIZATION, AuthUtils.genBasicAuth());
+
+ // http body
+ Map<String, String> params = new HashMap<>();
Review Comment:
It is recommended to use Java's POJO class to encapsulate request parameters instead of manually inserting Key and Value into Map.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org