Search in sources :

Example 6 with HeadMethod

use of org.apache.commons.httpclient.methods.HeadMethod in project sling by apache.

the class HeadServletTest method pngHead.

@Test
public void pngHead() throws IOException {
    final HeadMethod head = new HeadMethod(PNG_URL);
    final int status = H.getHttpClient().executeMethod(head);
    assertEquals(200, status);
    assertNull("Expecting null body", head.getResponseBody());
    assertCommonHeaders(head, "image/png");
}
Also used : HeadMethod(org.apache.commons.httpclient.methods.HeadMethod) HttpTest(org.apache.sling.commons.testing.integration.HttpTest) Test(org.junit.Test)

Aggregations

HeadMethod (org.apache.commons.httpclient.methods.HeadMethod)6 IOException (java.io.IOException)3 HttpClient (org.apache.commons.httpclient.HttpClient)3 HttpTest (org.apache.sling.commons.testing.integration.HttpTest)3 Test (org.junit.Test)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1 HttpException (org.apache.commons.httpclient.HttpException)1 MultiThreadedHttpConnectionManager (org.apache.commons.httpclient.MultiThreadedHttpConnectionManager)1 HttpConnectionManagerParams (org.apache.commons.httpclient.params.HttpConnectionManagerParams)1