RequestAcceptEncoding implements HttpRequestInterceptor { public void process( final HttpRequest request, final HttpContext context) throws HttpException, IOException { request.addHeader("Accept-Encoding", "gzip,deflate"); }  void process(
            final HttpRequest request,
            final HttpContext context);  }
@Test public void testAcceptEncoding() throws Exception { HttpRequest request = new BasicHttpRequest("GET", "/"); HttpContext context = new BasicHttpContext(); HttpRequestInterceptor interceptor = new RequestAcceptEncoding(); interceptor.process(request, context); Header header = request.getFirstHeader("Accept-Encoding"); Assert.assertNotNull(header); Assert.assertEquals("gzip,deflate", header.getValue()); }