public class HttpUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpUtil.HttpInputStream |
| Constructor and Description |
|---|
HttpUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
executeRequest(org.apache.http.client.methods.HttpRequestBase httpRequest,
int retryTimeout,
int injectSocketTimeout,
AtomicBoolean canceling)
Executes a HTTP request for Snowflake.
|
static org.apache.http.client.config.RequestConfig |
getDefaultRequestConfigWithSocketTimeout(int soTimeoutMs,
boolean withoutCookies)
Return a request configuration inheriting from the default request
configuration of the shared HttpClient with a different socket timeout.
|
static org.apache.http.impl.client.CloseableHttpClient |
getHttpClient()
Gets HttpClient with insecureMode false
|
static org.apache.http.client.config.RequestConfig |
getRequestConfigWithoutcookies()
Return a request configuration inheriting from the default request
configuration of the shared HttpClient with the coopkie spec set to ignore.
|
static org.apache.http.impl.client.CloseableHttpClient |
initHttpClient(boolean insecureMode,
File ocspCacheFile)
Accessor for the HTTP client singleton.
|
public static org.apache.http.impl.client.CloseableHttpClient getHttpClient()
public static org.apache.http.impl.client.CloseableHttpClient initHttpClient(boolean insecureMode,
File ocspCacheFile)
insecureMode - skip OCSP revocation check if true.ocspCacheFile - OCSP response cache file name. if null, the default
file will be used.public static org.apache.http.client.config.RequestConfig getDefaultRequestConfigWithSocketTimeout(int soTimeoutMs,
boolean withoutCookies)
soTimeoutMs - - custom socket timeout in milli-secondswithoutCookies - - whether this request should ignore cookies or notpublic static org.apache.http.client.config.RequestConfig getRequestConfigWithoutcookies()
public static String executeRequest(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int injectSocketTimeout, AtomicBoolean canceling) throws SnowflakeSQLException, IOException
httpRequest - HttpRequestBaseretryTimeout - retry timeoutinjectSocketTimeout - injecting socket timeoutcanceling - canceling?SnowflakeSQLException - if Snowflake error occursIOException - raises if a general IO error occursCopyright © 2018. All rights reserved.