String basicHttpFetcherProxy) { setMaxObjectSizeBytes(maxObjSize); setSlowResponseWarning(DEFAULT_SLOW_RESPONSE_WARNING);
String basicHttpFetcherProxy) { setMaxObjectSizeBytes(maxObjSize); setSlowResponseWarning(DEFAULT_SLOW_RESPONSE_WARNING);
String basicHttpFetcherProxy) { setMaxObjectSizeBytes(maxObjSize); setSlowResponseWarning(DEFAULT_SLOW_RESPONSE_WARNING);
@Test public void testHeadWithMaxObjectSizeBytes() throws Exception { fetcher.setMaxObjectSizeBytes(1024 * 1024); Uri uri = new UriBuilder(Uri.parse("http://www.google.com/search")) .addQueryParameter("body", "") .addQueryParameter("status", "200") .toUri(); HttpRequest request = new HttpRequest(uri); request.setMethod("HEAD"); HttpResponse response = fetcher.fetch(request); assertEquals(200, response.getHttpStatusCode()); assertEquals("", response.getResponseAsString()); } }
@Test public void testHeadWithMaxObjectSizeBytes() throws Exception { fetcher.setMaxObjectSizeBytes(1024 * 1024); Uri uri = new UriBuilder(Uri.parse("http://www.google.com/search")) .addQueryParameter("body", "") .addQueryParameter("status", "200") .toUri(); HttpRequest request = new HttpRequest(uri); request.setMethod("HEAD"); HttpResponse response = fetcher.fetch(request); assertEquals(200, response.getHttpStatusCode()); assertEquals("", response.getResponseAsString()); } }