Examples of MechanizeChainFilter


Examples of com.gistlabs.mechanize.filters.MechanizeChainFilter

    // tweak response to shorten cache time
    res2.getResponse().setHeader("Cache-Control", "max-age=0;must-revalidate");
    res2.getResponse().removeHeaders("Expires");

    // check between the cache and HttpClient to make sure the response is 304 not modified
    agent.addFilter(new MechanizeChainFilter() {
      @Override
      public HttpResponse execute(final HttpUriRequest request, final HttpContext context, final MechanizeFilter chain) {
        HttpResponse response = chain.execute(request, context);
        assertEquals(304, response.getStatusLine().getStatusCode());
        return response;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.