vernedeng commented on code in PR #9057:
URL: https://github.com/apache/inlong/pull/9057#discussion_r1378736172


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/util/HttpUtils.java:
##########
@@ -95,6 +95,24 @@ public static <T> T request(RestTemplate restTemplate, 
String url, HttpMethod me
         }
     }
 
+    /**
+     * Send HEAD request to the specified URL.
+     */
+    public static boolean headRequest(RestTemplate restTemplate, String url, 
Map<String, Object> params,
+            HttpHeaders header) {
+        ResponseEntity<String> exchange;
+        boolean result = false;
+        HttpEntity<String> request = new HttpEntity(params, header);
+        log.debug("send request to {}, param {}", url, params);
+        exchange = restTemplate.exchange(url, HttpMethod.HEAD, request, 
String.class);
+        HttpStatus statusCode = exchange.getStatusCode();
+        if (statusCode.is2xxSuccessful()) {
+            result = true;

Review Comment:
   ```suggestion
               result = statusCode.is2xxSuccessful()
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to