[JAVA-15033] Update article Apache HttpClient 4 Cookbook (#14266)

This commit is contained in:
panos-kakos
2023-06-22 13:16:56 +03:00
committed by GitHub
parent d283aba01e
commit 818c6aa19e
4 changed files with 415 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package com.baeldung.httpclient;
import java.io.IOException;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.impl.client.CloseableHttpClient;
public final class ClientUtil {
private ClientUtil(){}
public static void closeClient(CloseableHttpClient client) throws IOException {
if (client == null) {
return;
}
client.close();
}
}