[JAVA-15033] Update article Apache HttpClient 4 Cookbook (#14266)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user