Reputation: 140
I am not getting any method to close 'client' object. i am doing as part of fortify bug to close socket.
org.apache.http.client.HttpClient client = HttpClientBuilder.create().build();
Here, I have to close this but not able to find any close method.
Upvotes: 0
Views: 5661
Reputation: 141
I think you should use HttpClients.createDefault(); method which returns a CloseableHttpClient object that can be closed manually. more info here : https://www.tutorialspoint.com/apache_httpclient/apache_httpclient_closing_connection.htm
Upvotes: 1