Code example for BasicHttpRequest

Methods: addHeader

0
        request.addHeader("Cache-Control", "no-store");
        request.addHeader("Cache-Control", "max-age=20");
 
        Assert.assertFalse(policy.isServableFromCache(request));
 
        request = new BasicHttpRequest("GET", "someUri");
        request.addHeader("Cache-Control", "public");
        request.addHeader("Cache-Control", "no-store, max-age=20");
 
        Assert.assertFalse(policy.isServableFromCache(request));
    } 
 
    @Test 
    public void testIsGetWithPragmaServableFromCache() { 
        BasicHttpRequest request = new BasicHttpRequest("GET", "someUri");
        request.addHeader("Pragma", "no-cache");
 
        Assert.assertFalse(policy.isServableFromCache(request));
 
        request = new BasicHttpRequest("GET", "someUri");
Contextual code suggestions in your IDE  Get Codota for Java