### Question:
HttpRetriever { public HttpResult httpGet(String url) throws HttpException { return execute(new HttpRequest2Builder(HttpMethod.GET, url).create()); } HttpRetriever(ClientConnectionManager connectionManager); HttpResult httpGet(String url); HttpResult httpHead(String url); HttpResult httpHead(String url, Map<String, String> headers); @Deprecated HttpResult execute(HttpRequest request); HttpResult execute(HttpRequest2 request); List<String> getRedirectUrls(String url); boolean downloadAndSave(String url, String filePath); boolean downloadAndSave(String url, String filePath, boolean includeHttpResponseHeaders); boolean downloadAndSave(String url, String filePath, Map<String, String> requestHeaders,
                                   boolean includeHttpResponseHeaders); void setConnectionTimeout(int connectionTimeout); void setSocketTimeout(int socketTimeout); void setNumRetries(int numRetries); void setUserAgent(String userAgent); void setMaxFileSize(long maxFileSize); void setCookieStore(CookieStore cookieStore); static long getTraffic(SizeUnit unit); static void resetTraffic(); void setProxyProvider(ProxyProvider proxyProvider); ProxyProvider getProxyProvider(); void setConnectionTimeoutRedirects(int connectionTimeoutRedirects); void setSocketTimeoutRedirects(int socketTimeoutRedirects); Set<Integer> getProxyRemoveStatusCodes(); void setProxyRemoveStatusCodes(Set<Integer> proxyRemoveStatusCodes); ProxyRemoverCallback getProxyRemoveCallback(); void setProxyRemoveCallback(ProxyRemoverCallback proxyRemoveCallback); static final String USER_AGENT; static final int DEFAULT_CONNECTION_TIMEOUT; static final int DEFAULT_CONNECTION_TIMEOUT_REDIRECTS; static final int DEFAULT_SOCKET_TIMEOUT; static final int MAX_REDIRECTS; static final int DEFAULT_SOCKET_TIMEOUT_REDIRECTS; static final int DEFAULT_NUM_RETRIES; }### Answer:
@Test @Ignore public void testCookieWarning() throws HttpException { HttpRetrieverFactory.getHttpRetriever().httpGet("http: }
@Test public void testSelfSignedCertificate() throws HttpException { try (HttpRetrieverFactory factory = new HttpRetrieverFactory(true)) { HttpRetriever retriever = factory.create(); HttpResult result = retriever.httpGet("https: System.out.println(result); } }
@Test public void testGetExample() throws HttpException { HttpResult result = HttpRetrieverFactory.getHttpRetriever().httpGet("http: System.out.println(result); }
@Test public void testUnknownCertificate() throws HttpException { try (HttpRetrieverFactory factory = new HttpRetrieverFactory(true)) { HttpRetriever retriever = factory.create(); HttpResult result = retriever.httpGet("https: System.out.println(result); } }
@Test @Ignore public void testSslSni() throws HttpException { try (HttpRetrieverFactory factory = new HttpRetrieverFactory(true)) { HttpRetriever retriever = factory.create(); HttpResult result = retriever.httpGet("https: System.out.println(result); } }
@Test @Ignore public void testSSLPeerUnverified() throws HttpException { try (HttpRetrieverFactory factory = new HttpRetrieverFactory(true)) { HttpRetriever retriever = factory.create(); HttpResult result = retriever.httpGet("https: System.out.println(result); } }
@Test @Ignore public void testCookies_issue286() throws HttpException { HttpRetriever httpRetriever = HttpRetrieverFactory.getHttpRetriever(); String url = "http: HttpResult httpResult = httpRetriever.httpGet(url); System.out.println(httpResult.getStatusCode()); System.out.println(httpResult.getStringContent()); }