The recommended way, by Httpcomponents 4.1, is to close connection and release any underlying resources:
EntityUtils.consume(HttpEntity)
where HttpEntity
passed is a response entity.
More Related Contents:
- How to connect with Web Api Spotify (in Java)?
- java.net.SocketException: Connection reset
- Is it safe to use a static java.sql.Connection instance in a multithreaded system?
- When to close Connection, Statement, PreparedStatement and ResultSet in JDBC
- How can I get an HTTP response body as a string?
- Deprecated Java HttpClient – How hard can it be?
- Java detect lost connection [duplicate]
- Android project using httpclient –> http.client (apache), post/get method
- What is the difference between connection and read timeout for sockets?
- java.rmi.ConnectException: Connection refused to host: 127.0.1.1;
- How do I use an SSL client certificate with Apache HttpClient?
- Why would a “java.net.ConnectException: Connection timed out” exception occur when URL is up?
- Apache HTTPClient SSLPeerUnverifiedException
- java.net.SocketException: Too many open files
- java.lang.NoSuchFieldError: org.apache.http.message.BasicLineFormatter.INSTANCE from Mashape Unirest in Java application
- Apache HttpClient timeout
- Apache HttpClient 4.0.3 – how do I set cookie with sessionID for POST request?
- HTTPClient Example – Exception in thread “main” java.lang.NoSuchFieldError: INSTANCE
- RMI connection refused on localhost
- HttpClient 4 – how to capture last redirect URL
- Receiving Multipart Response on client side (ClosableHttpResponse)
- HttpClient.getParams() deprecated. What should I use instead?
- javax.net.ssl.SSLPeerUnverifiedException: Host name does not match the certificate subject provided by the peer
- JsonParseException : Illegal unquoted character ((CTRL-CHAR, code 10)
- HttpClientBuilder basic auth
- How to use Socks 5 proxy with Apache HTTP Client 4?
- Correct way to implement HTTP Connection Pooling
- SSH connection with Java
- Does Apache Commons HttpClient support GZIP?
- Need Code to create Connection Pool in java