Code example for AbstractHttpClient

Methods: getCookieSpecs, getParams

0
//                        all cookies are accepted 
                    } 
                }; 
            } 
        }; 
        httpClient.getCookieSpecs().register("accept_all", acceptAllFactory);
        httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY, "accept_all");
    } 
 
    public static void addGzipCompression(AbstractHttpClient httpClient) {
        httpClient.addRequestInterceptor(new HttpRequestInterceptor() {
            public void process( 
                    final HttpRequest request,
                    final HttpContext context) throws HttpException, IOException {
                if (!request.containsHeader("Accept-Encoding")) {
                    request.addHeader("Accept-Encoding", "gzip");
                } 
            } 
        }); 
 
        httpClient.addResponseInterceptor(new HttpResponseInterceptor() {