Class RequestConnectionClose

  • All Implemented Interfaces:
    HttpRequestInterceptor

    public class RequestConnectionClose
    extends Object
    implements HttpRequestInterceptor
    Adds a Connection: close to all HTTP/1.1 requests.

    This interceptor essentially disables connection keep-alive support and, by virtue of the server closing the connection, prevents a ClientConnectionManager from holding open and reusing connections. If you'd like to allow the ClientConnectionManager to hold open connections for a while and potentially reuse them consider using the IdleConnectionSweeper to limit the amount of time the connections are held open.