Code example for BasicHttpRequest

Methods: getFirstHeader

0
        assertNotNull(h2);
    } 
 
    public void testRequestDateNotGenerated() throws Exception { 
        HttpContext context = new BasicHttpContext(null);
        BasicHttpRequest request = new BasicHttpRequest("GET", "/");
 
        RequestDate interceptor = new RequestDate();
        interceptor.process(request, context);
        Header h1 = request.getFirstHeader(HTTP.DATE_HEADER);
        assertNull(h1);
    } 
 
    public void testRequestDateInvalidInput() throws Exception { 
        RequestDate interceptor = new RequestDate();
        try { 
            interceptor.process(null, null);
            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected 
Connect your IDE to all the code out there  Get Codota for Java