public static CloseableHttpAsyncClient defaultClient ( ) { RequestConfig requestConfig = RequestConfig . custom ( ) . setConnectionRequestTimeout ( 0 ) . setConnectTimeout ( 10000 ) . setSocketTimeout ( 20000 ) . setCookieSpec ( CookieSpecs . STANDARD ) . build ( ) ; HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClients . custom ( ) ; httpClientBuilder . setDefaultRequestConfig ( requestConfig ) ; CloseableHttpAsyncClient asyncHttpClient = httpClientBuilder . build ( ) ; asyncHttpClient . start ( ) ; return asyncHttpClient ; }
Creates a simple default http client