public Response head() throws IOException { setMethod(ConnectionMethod.HEAD); return execute(); }
public Response get() throws IOException { setMethod(ConnectionMethod.GET); return execute(); }
public Response post() throws IOException { setMethod(ConnectionMethod.POST); return execute(); }
public Response options() throws IOException { setMethod(ConnectionMethod.OPTIONS); return execute(); }
public Response put() throws IOException { setMethod(ConnectionMethod.PUT); return execute(); }
public Response head() throws IOException { setMethod(ConnectionMethod.HEAD); return execute(); }
public Response delete() throws IOException { setMethod(ConnectionMethod.DELETE); return execute(); }
public Response trace() throws IOException { setMethod(ConnectionMethod.TRACE); return execute(); }
public Response put() throws IOException { setMethod(ConnectionMethod.PUT); return execute(); }
public Response get() throws IOException { setMethod(ConnectionMethod.GET); return execute(); }
public Response post() throws IOException { setMethod(ConnectionMethod.POST); return execute(); }
public Response trace() throws IOException { setMethod(ConnectionMethod.TRACE); return execute(); }
public Response delete() throws IOException { setMethod(ConnectionMethod.DELETE); return execute(); }
public Response options() throws IOException { setMethod(ConnectionMethod.OPTIONS); return execute(); }
@Test public void testHead() throws IOException { handler = (request, response) -> response.setBody("response"); com.wizzardo.tools.http.Response response = makeRequest("/").setMethod(ConnectionMethod.HEAD).execute(); Assert.assertEquals(200, response.getResponseCode()); Assert.assertEquals("8", response.header("Content-Length")); Assert.assertEquals("", response.asString()); Assert.assertEquals("response", makeRequest("/").get().asString()); }