Package net.snowflake.client.core

## Class HttpUtil

- java.lang.Object
- - net.snowflake.client.core.HttpUtil

    public class HttpUtil
    extends Object

HttpUtil class

### Nested Class Summary

Nested Classes
`static class` `HttpUtil.HttpInputStream`

### Field Summary

Fields
`static Map<HttpClientSettingsKey,​org.apache.http.impl.client.CloseableHttpClient>` `httpClient` The unique httpClient shared by all connections.
`static String` `JDBC_MAX_CONNECTIONS_PER_ROUTE_PROPERTY`
`static String` `JDBC_MAX_CONNECTIONS_PROPERTY`
`static String` `JDBC_TTL`

### Constructor Summary

Constructors
`HttpUtil()`

### Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods
`static org.apache.http.impl.client.CloseableHttpClient` `buildHttpClient​(HttpClientSettingsKey key, File ocspCacheFile, boolean downloadUnCompressed)` Build an Http client using our set of default.
`static org.apache.http.impl.client.CloseableHttpClient` `buildHttpClient​(HttpClientSettingsKey key, File ocspCacheFile, boolean downloadUnCompressed, List<HttpHeadersCustomizer> httpHeadersCustomizers)` Build an Http client using our set of default.
`static void` `closeExpiredAndIdleConnections()`
`static String` `executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int retryCount, HttpClientSettingsKey ocspAndProxyAndGzipKey)` Deprecated.
`static String` `executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int retryCount, HttpClientSettingsKey ocspAndProxyAndGzipKey, SFBaseSession sfSession)` Executes an HTTP request for Snowflake.
`static String` `executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int retryCount, HttpClientSettingsKey ocspAndProxyAndGzipKey, RetryContextManager retryContextManager, SFBaseSession sfSession)` Executes an HTTP request for Snowflake.
`static String` `executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int retryCount, org.apache.http.impl.client.CloseableHttpClient httpClient)` Deprecated.
`static String` `executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int retryCount, org.apache.http.impl.client.CloseableHttpClient httpClient, SFBaseSession sfSession)` Executes an HTTP request for Snowflake
`static String` `executeGeneralRequestOmitRequestGuid​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int retryCount, HttpClientSettingsKey ocspAndProxyAndGzipKey, SFBaseSession sfSession)`
`static String` `executeRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int maxRetries, int injectSocketTimeout, AtomicBoolean canceling, boolean includeRetryParameters, boolean retryOnHTTP403, HttpClientSettingsKey ocspAndProxyKey, ExecTimeTelemetryData execTimeData)` Deprecated.

`static String`

`executeRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int maxRetries, int injectSocketTimeout, AtomicBoolean canceling, boolean includeRetryParameters, boolean retryOnHTTP403, HttpClientSettingsKey ocspAndProxyKey, ExecTimeTelemetryData execTimeData, SFBaseSession sfSession)`

Executes an HTTP request for Snowflake.

`static String` `executeRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int maxRetries, int injectSocketTimeout, AtomicBoolean canceling, boolean includeRetryParameters, boolean retryOnHTTP403, HttpClientSettingsKey ocspAndProxyKey, ExecTimeTelemetryData execTimeData, RetryContextManager retryContextManager)` Deprecated.

`static String`

`executeRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest, int retryTimeout, int authTimeout, int socketTimeout, int maxRetries, int injectSocketTimeout, AtomicBoolean canceling, boolean includeRetryParameters, boolean retryOnHTTP403, HttpClientSettingsKey ocspAndProxyKey, ExecTimeTelemetryData execTimeData, RetryContextManager retryContextManager, SFBaseSession sfSession)`

Executes an HTTP request for Snowflake.

`static Duration` `getConnectionTimeout()`
`static org.apache.http.client.config.RequestConfig` `getDefaultRequestConfigWithSocketAndConnectTimeout​(int requestSocketAndConnectTimeout, boolean withoutCookies)` Return a request configuration inheriting from the default request configuration of the shared HttpClient with a different socket and connect timeout.
`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 long` `getDownloadedConditionTimeoutInSeconds()`
`static org.apache.http.impl.client.CloseableHttpClient` `getHttpClient​(HttpClientSettingsKey ocspAndProxyKey)` Gets HttpClient with insecureMode false
`static org.apache.http.impl.client.CloseableHttpClient` `getHttpClient​(HttpClientSettingsKey ocspAndProxyKey, List<HttpHeadersCustomizer> httpHeadersCustomizers)` Gets HttpClient with insecureMode false
`static org.apache.http.impl.client.CloseableHttpClient` `getHttpClientWithoutDecompression​(HttpClientSettingsKey ocspAndProxyKey)` Gets HttpClient with insecureMode false and disabling decompression
`static org.apache.http.impl.client.CloseableHttpClient` `getHttpClientWithoutDecompression​(HttpClientSettingsKey ocspAndProxyKey, List<HttpHeadersCustomizer> httpHeadersCustomizers)` Gets HttpClient with insecureMode false and disabling decompression
`static org.apache.http.client.config.RequestConfig` `getRequestConfigWithoutCookies()` Return a request configuration inheriting from the default request configuration of the shared HttpClient with the cookie spec set to ignore.
`static Duration` `getSocketTimeout()`
`static org.apache.http.impl.client.CloseableHttpClient` `initHttpClient​(HttpClientSettingsKey key, File ocspCacheFile)` Accessor for the HTTP client singleton.
`static org.apache.http.impl.client.CloseableHttpClient` `initHttpClient​(HttpClientSettingsKey key, File ocspCacheFile, List<HttpHeadersCustomizer> httpHeadersCustomizers)` Accessor for the HTTP client singleton.
`static org.apache.http.impl.client.CloseableHttpClient` `initHttpClientWithoutDecompression​(HttpClientSettingsKey key, File ocspCacheFile)` Accessor for the HTTP client singleton.
`static org.apache.http.impl.client.CloseableHttpClient` `initHttpClientWithoutDecompression​(HttpClientSettingsKey key, File ocspCacheFile, List<HttpHeadersCustomizer> httpHeadersCustomizers)` Accessor for the HTTP client singleton.
`static boolean` `isSocksProxyDisabled()` Returns whether the SOCKS proxy is disabled for this JVM
`static void` `reset()`
`static void` `setConnectionTimeout​(int timeout)`
`static void` `setProxyForAzure​(HttpClientSettingsKey key, com.microsoft.azure.storage.OperationContext opContext)` A static function to set Azure proxy params when there is a valid session
`static void` `setProxyForS3​(HttpClientSettingsKey key, com.amazonaws.ClientConfiguration clientConfig)` Deprecated. Use `S3HttpUtil.setProxyForS3(HttpClientSettingsKey, ClientConfiguration)` instead
`static void` `setRequestConfig​(org.apache.http.client.config.RequestConfig requestConfig)`
`static void` `setSessionlessProxyForAzure​(Properties proxyProperties, com.microsoft.azure.storage.OperationContext opContext)` A static function to set Azure proxy params for sessionless connections using the proxy params from the StageInfo
`static void` `setSessionlessProxyForS3​(Properties proxyProperties, com.amazonaws.ClientConfiguration clientConfig)` Deprecated. Use `S3HttpUtil.setSessionlessProxyForS3(Properties, ClientConfiguration)` instead
`static void` `setSocketTimeout​(int timeout)`
`static void` `setSocksProxyDisabled​(boolean socksProxyDisabled)` Enables/disables use of the SOCKS proxy when creating sockets
`static void` `updateRoutePlanner​(HttpClientSettingsKey key)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### JDBC_TTL

    public static final String JDBC_TTL

See Also:
  Constant Field Values

#### JDBC_MAX_CONNECTIONS_PROPERTY

    public static final String JDBC_MAX_CONNECTIONS_PROPERTY

See Also:
  Constant Field Values

#### JDBC_MAX_CONNECTIONS_PER_ROUTE_PROPERTY

    public static final String JDBC_MAX_CONNECTIONS_PER_ROUTE_PROPERTY

See Also:
  Constant Field Values

#### httpClient

    public static Map<HttpClientSettingsKey,​org.apache.http.impl.client.CloseableHttpClient> httpClient

The unique httpClient shared by all connections. This will benefit long-lived clients. Key = proxy host + proxy port + nonProxyHosts, Value = Map of [OCSPMode, HttpClient]

### Constructor Detail

#### HttpUtil

    public HttpUtil()

### Method Detail

#### reset

    @SnowflakeJdbcInternalApi
    public static void reset()

#### getConnectionTimeout

    @SnowflakeJdbcInternalApi
    public static Duration getConnectionTimeout()

#### getSocketTimeout

    @SnowflakeJdbcInternalApi
    public static Duration getSocketTimeout()

#### setConnectionTimeout

    @SnowflakeJdbcInternalApi
    public static void setConnectionTimeout​(int timeout)

#### setSocketTimeout

    @SnowflakeJdbcInternalApi
    public static void setSocketTimeout​(int timeout)

#### getDownloadedConditionTimeoutInSeconds

    public static long getDownloadedConditionTimeoutInSeconds()

#### closeExpiredAndIdleConnections

    public static void closeExpiredAndIdleConnections()

#### setProxyForS3

    @Deprecated
    public static void setProxyForS3​(HttpClientSettingsKey key,
                                     com.amazonaws.ClientConfiguration clientConfig)

Deprecated.
Use `S3HttpUtil.setProxyForS3(HttpClientSettingsKey, ClientConfiguration)` instead
A static function to set S3 proxy params when there is a valid session

Parameters:
  `key` - key to HttpClient map containing OCSP and proxy info
  `clientConfig` - the configuration needed by S3 to set the proxy

#### setSessionlessProxyForS3

    @Deprecated
    public static void setSessionlessProxyForS3​(Properties proxyProperties,
                                                com.amazonaws.ClientConfiguration clientConfig)
                                         throws SnowflakeSQLException

Deprecated.
Use `S3HttpUtil.setSessionlessProxyForS3(Properties, ClientConfiguration)` instead
A static function to set S3 proxy params for sessionless connections using the proxy params from the StageInfo

Parameters:
  `proxyProperties` - proxy properties
  `clientConfig` - the configuration needed by S3 to set the proxy
Throws:
  `SnowflakeSQLException` - when exception encountered

#### setSessionlessProxyForAzure

    public static void setSessionlessProxyForAzure​(Properties proxyProperties,
                                                   com.microsoft.azure.storage.OperationContext opContext)
                                            throws SnowflakeSQLException

A static function to set Azure proxy params for sessionless connections using the proxy params from the StageInfo

Parameters:
  `proxyProperties` - proxy properties
  `opContext` - the configuration needed by Azure to set the proxy
Throws:
  `SnowflakeSQLException` - when invalid proxy properties encountered

#### setProxyForAzure

    public static void setProxyForAzure​(HttpClientSettingsKey key,
                                        com.microsoft.azure.storage.OperationContext opContext)

A static function to set Azure proxy params when there is a valid session

Parameters:
  `key` - key to HttpClient map containing OCSP and proxy info
  `opContext` - the configuration needed by Azure to set the proxy

#### buildHttpClient

    public static org.apache.http.impl.client.CloseableHttpClient buildHttpClient​(@Nullable
                                                                                  HttpClientSettingsKey key,
                                                                                  File ocspCacheFile,
                                                                                  boolean downloadUnCompressed)

Build an Http client using our set of default.

Parameters:
  `key` - Key to HttpClient hashmap containing OCSP mode and proxy information, could be null
  `ocspCacheFile` - OCSP response cache file. If null, the default OCSP response file will be used.
  `downloadUnCompressed` - Whether the HTTP client should be built requesting no decompression
Returns:
  HttpClient object

#### buildHttpClient

    public static org.apache.http.impl.client.CloseableHttpClient buildHttpClient​(@Nullable
                                                                                  HttpClientSettingsKey key,
                                                                                  File ocspCacheFile,
                                                                                  boolean downloadUnCompressed,
                                                                                  List<HttpHeadersCustomizer> httpHeadersCustomizers)

Build an Http client using our set of default.

Parameters:
  `key` - Key to HttpClient hashmap containing OCSP mode and proxy information, could be null
  `ocspCacheFile` - OCSP response cache file. If null, the default OCSP response file will be used.
  `downloadUnCompressed` - Whether the HTTP client should be built requesting no decompression
  `httpHeadersCustomizers` - List of HTTP headers customizers
Returns:
  HttpClient object

#### updateRoutePlanner

    public static void updateRoutePlanner​(HttpClientSettingsKey key)

#### getHttpClient

    public static org.apache.http.impl.client.CloseableHttpClient getHttpClient​(HttpClientSettingsKey ocspAndProxyKey)

Gets HttpClient with insecureMode false

Parameters:
  `ocspAndProxyKey` - OCSP mode and proxy settings for httpclient
Returns:
  HttpClient object shared across all connections

#### getHttpClientWithoutDecompression

    public static org.apache.http.impl.client.CloseableHttpClient getHttpClientWithoutDecompression​(HttpClientSettingsKey ocspAndProxyKey)

Gets HttpClient with insecureMode false and disabling decompression

Parameters:
  `ocspAndProxyKey` - OCSP mode and proxy settings for httpclient
Returns:
  HttpClient object shared across all connections

#### getHttpClient

    public static org.apache.http.impl.client.CloseableHttpClient getHttpClient​(HttpClientSettingsKey ocspAndProxyKey,
                                                                                List<HttpHeadersCustomizer> httpHeadersCustomizers)

Gets HttpClient with insecureMode false

Parameters:
  `ocspAndProxyKey` - OCSP mode and proxy settings for httpclient
  `httpHeadersCustomizers` - List of HTTP headers customizers
Returns:
  HttpClient object shared across all connections

#### getHttpClientWithoutDecompression

    public static org.apache.http.impl.client.CloseableHttpClient getHttpClientWithoutDecompression​(HttpClientSettingsKey ocspAndProxyKey,
                                                                                                    List<HttpHeadersCustomizer> httpHeadersCustomizers)

Gets HttpClient with insecureMode false and disabling decompression

Parameters:
  `ocspAndProxyKey` - OCSP mode and proxy settings for httpclient
  `httpHeadersCustomizers` - List of HTTP headers customizers
Returns:
  HttpClient object shared across all connections

#### initHttpClientWithoutDecompression

    public static org.apache.http.impl.client.CloseableHttpClient initHttpClientWithoutDecompression​(HttpClientSettingsKey key,
                                                                                                     File ocspCacheFile)

Accessor for the HTTP client singleton.

Parameters:
  `key` - contains information needed to build specific HttpClient
  `ocspCacheFile` - OCSP response cache file name. if null, the default file will be used.
Returns:
  HttpClient object shared across all connections

#### initHttpClient

    public static org.apache.http.impl.client.CloseableHttpClient initHttpClient​(HttpClientSettingsKey key,
                                                                                 File ocspCacheFile)

Accessor for the HTTP client singleton.

Parameters:
  `key` - contains information needed to build specific HttpClient
  `ocspCacheFile` - OCSP response cache file name. if null, the default file will be used.
Returns:
  HttpClient object shared across all connections

#### initHttpClientWithoutDecompression

    public static org.apache.http.impl.client.CloseableHttpClient initHttpClientWithoutDecompression​(HttpClientSettingsKey key,
                                                                                                     File ocspCacheFile,
                                                                                                     List<HttpHeadersCustomizer> httpHeadersCustomizers)

Accessor for the HTTP client singleton.

Parameters:
  `key` - contains information needed to build specific HttpClient
  `ocspCacheFile` - OCSP response cache file name. if null, the default file will be used.
  `httpHeadersCustomizers` - List of HTTP headers customizers
Returns:
  HttpClient object shared across all connections

#### initHttpClient

    public static org.apache.http.impl.client.CloseableHttpClient initHttpClient​(HttpClientSettingsKey key,
                                                                                 File ocspCacheFile,
                                                                                 List<HttpHeadersCustomizer> httpHeadersCustomizers)

Accessor for the HTTP client singleton.

Parameters:
  `key` - contains information needed to build specific HttpClient
  `ocspCacheFile` - OCSP response cache file name. if null, the default file will be used.
  `httpHeadersCustomizers` - List of HTTP headers customizers
Returns:
  HttpClient object shared across all connections

#### getDefaultRequestConfigWithSocketTimeout

    public 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.

Parameters:
  `soTimeoutMs` - - custom socket timeout in milli-seconds
  `withoutCookies` - - whether this request should ignore cookies or not
Returns:
  RequestConfig object

#### getDefaultRequestConfigWithSocketAndConnectTimeout

    public static org.apache.http.client.config.RequestConfig getDefaultRequestConfigWithSocketAndConnectTimeout​(int requestSocketAndConnectTimeout,
                                                                                                                 boolean withoutCookies)

Return a request configuration inheriting from the default request configuration of the shared HttpClient with a different socket and connect timeout.

Parameters:
  `requestSocketAndConnectTimeout` - - custom socket and connect timeout in milli-seconds
  `withoutCookies` - - whether this request should ignore cookies or not
Returns:
  RequestConfig object

#### getRequestConfigWithoutCookies

    public static org.apache.http.client.config.RequestConfig getRequestConfigWithoutCookies()

Return a request configuration inheriting from the default request configuration of the shared HttpClient with the cookie spec set to ignore.

Returns:
  RequestConfig object

#### setRequestConfig

    public static void setRequestConfig​(org.apache.http.client.config.RequestConfig requestConfig)

#### setSocksProxyDisabled

    public static void setSocksProxyDisabled​(boolean socksProxyDisabled)

Enables/disables use of the SOCKS proxy when creating sockets

Parameters:
  `socksProxyDisabled` - new value

#### isSocksProxyDisabled

    public static boolean isSocksProxyDisabled()

Returns whether the SOCKS proxy is disabled for this JVM

Returns:
  whether the SOCKS proxy is disabled

#### executeGeneralRequest

    @Deprecated
    public static String executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                               int retryTimeout,
                                               int authTimeout,
                                               int socketTimeout,
                                               int retryCount,
                                               HttpClientSettingsKey ocspAndProxyAndGzipKey)
                                        throws SnowflakeSQLException,
                                               IOException

Deprecated.
Executes an HTTP request for Snowflake.

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator specific timeout
  `socketTimeout` - socket timeout (in ms)
  `retryCount` - max retry count for the request - if it is set to 0, it will be ignored and only retryTimeout will determine when to end the retries
  `ocspAndProxyAndGzipKey` - OCSP mode and proxy settings for httpclient
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs

#### executeGeneralRequest

    @SnowflakeJdbcInternalApi
    public static String executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                               int retryTimeout,
                                               int authTimeout,
                                               int socketTimeout,
                                               int retryCount,
                                               HttpClientSettingsKey ocspAndProxyAndGzipKey,
                                               SFBaseSession sfSession)
                                        throws SnowflakeSQLException,
                                               IOException

Executes an HTTP request for Snowflake.

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator specific timeout
  `socketTimeout` - socket timeout (in ms)
  `retryCount` - max retry count for the request - if it is set to 0, it will be ignored and only retryTimeout will determine when to end the retries
  `ocspAndProxyAndGzipKey` - OCSP mode and proxy settings for httpclient
  `sfSession` - the session associated with the request
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs

#### executeGeneralRequestOmitRequestGuid

    @SnowflakeJdbcInternalApi
    public static String executeGeneralRequestOmitRequestGuid​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                                              int retryTimeout,
                                                              int authTimeout,
                                                              int socketTimeout,
                                                              int retryCount,
                                                              HttpClientSettingsKey ocspAndProxyAndGzipKey,
                                                              SFBaseSession sfSession)
                                                       throws SnowflakeSQLException,
                                                              IOException

Throws:
  `SnowflakeSQLException`
  `IOException`

#### executeGeneralRequest

    @SnowflakeJdbcInternalApi
    public static String executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                               int retryTimeout,
                                               int authTimeout,
                                               int socketTimeout,
                                               int retryCount,
                                               HttpClientSettingsKey ocspAndProxyAndGzipKey,
                                               RetryContextManager retryContextManager,
                                               SFBaseSession sfSession)
                                        throws SnowflakeSQLException,
                                               IOException

Executes an HTTP request for Snowflake.

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator specific timeout
  `socketTimeout` - socket timeout (in ms)
  `retryCount` - max retry count for the request - if it is set to 0, it will be ignored and only retryTimeout will determine when to end the retries
  `ocspAndProxyAndGzipKey` - OCSP mode and proxy settings for httpclient
  `retryContextManager` - RetryContext used to customize retry handling functionality
  `sfSession` - the session associated with the request
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs

#### executeGeneralRequest

    @Deprecated
    public static String executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                               int retryTimeout,
                                               int authTimeout,
                                               int socketTimeout,
                                               int retryCount,
                                               org.apache.http.impl.client.CloseableHttpClient httpClient)
                                        throws SnowflakeSQLException,
                                               IOException

Deprecated.
Executes an HTTP request for Snowflake

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator specific timeout
  `socketTimeout` - socket timeout (in ms)
  `retryCount` - max retry count for the request - if it is set to 0, it will be ignored and only retryTimeout will determine when to end the retries
  `httpClient` - client object used to communicate with other machine
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs

#### executeGeneralRequest

    @SnowflakeJdbcInternalApi
    public static String executeGeneralRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                               int retryTimeout,
                                               int authTimeout,
                                               int socketTimeout,
                                               int retryCount,
                                               org.apache.http.impl.client.CloseableHttpClient httpClient,
                                               SFBaseSession sfSession)
                                        throws SnowflakeSQLException,
                                               IOException

Executes an HTTP request for Snowflake

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator specific timeout
  `socketTimeout` - socket timeout (in ms)
  `retryCount` - max retry count for the request - if it is set to 0, it will be ignored and only retryTimeout will determine when to end the retries
  `httpClient` - client object used to communicate with other machine
  `sfSession` - the session associated with the request
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs

#### executeRequest

    @Deprecated
    public static String executeRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                        int retryTimeout,
                                        int authTimeout,
                                        int socketTimeout,
                                        int maxRetries,
                                        int injectSocketTimeout,
                                        AtomicBoolean canceling,
                                        boolean includeRetryParameters,
                                        boolean retryOnHTTP403,
                                        HttpClientSettingsKey ocspAndProxyKey,
                                        ExecTimeTelemetryData execTimeData)
                                 throws SnowflakeSQLException,
                                        IOException

Deprecated.
Executes an HTTP request for Snowflake.

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator timeout
  `socketTimeout` - socket timeout (in ms)
  `maxRetries` - retry count for the request
  `injectSocketTimeout` - injecting socket timeout
  `canceling` - canceling?
  `includeRetryParameters` - whether to include retry parameters in retried requests
  `retryOnHTTP403` - whether to retry on HTTP 403 or not
  `ocspAndProxyKey` - OCSP mode and proxy settings for httpclient
  `execTimeData` - query execution time telemetry data object
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs

#### executeRequest

    @SnowflakeJdbcInternalApi
    public static String executeRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                        int retryTimeout,
                                        int authTimeout,
                                        int socketTimeout,
                                        int maxRetries,
                                        int injectSocketTimeout,
                                        AtomicBoolean canceling,
                                        boolean includeRetryParameters,
                                        boolean retryOnHTTP403,
                                        HttpClientSettingsKey ocspAndProxyKey,
                                        ExecTimeTelemetryData execTimeData,
                                        SFBaseSession sfSession)
                                 throws SnowflakeSQLException,
                                        IOException

Executes an HTTP request for Snowflake.

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator timeout
  `socketTimeout` - socket timeout (in ms)
  `maxRetries` - retry count for the request
  `injectSocketTimeout` - injecting socket timeout
  `canceling` - canceling?
  `includeRetryParameters` - whether to include retry parameters in retried requests
  `retryOnHTTP403` - whether to retry on HTTP 403 or not
  `ocspAndProxyKey` - OCSP mode and proxy settings for httpclient
  `execTimeData` - query execution time telemetry data object
  `sfSession` - the session associated with the request
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs

#### executeRequest

    @Deprecated
    public static String executeRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                        int retryTimeout,
                                        int authTimeout,
                                        int socketTimeout,
                                        int maxRetries,
                                        int injectSocketTimeout,
                                        AtomicBoolean canceling,
                                        boolean includeRetryParameters,
                                        boolean retryOnHTTP403,
                                        HttpClientSettingsKey ocspAndProxyKey,
                                        ExecTimeTelemetryData execTimeData,
                                        RetryContextManager retryContextManager)
                                 throws SnowflakeSQLException,
                                        IOException

Deprecated.
Executes an HTTP request for Snowflake.

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator timeout
  `socketTimeout` - socket timeout (in ms)
  `maxRetries` - retry count for the request
  `injectSocketTimeout` - injecting socket timeout
  `canceling` - canceling?
  `includeRetryParameters` - whether to include retry parameters in retried requests
  `retryOnHTTP403` - whether to retry on HTTP 403 or not
  `ocspAndProxyKey` - OCSP mode and proxy settings for httpclient
  `execTimeData` - query execution time telemetry data object
  `retryContextManager` - RetryContext used to customize retry handling functionality
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs

#### executeRequest

    @SnowflakeJdbcInternalApi
    public static String executeRequest​(org.apache.http.client.methods.HttpRequestBase httpRequest,
                                        int retryTimeout,
                                        int authTimeout,
                                        int socketTimeout,
                                        int maxRetries,
                                        int injectSocketTimeout,
                                        AtomicBoolean canceling,
                                        boolean includeRetryParameters,
                                        boolean retryOnHTTP403,
                                        HttpClientSettingsKey ocspAndProxyKey,
                                        ExecTimeTelemetryData execTimeData,
                                        RetryContextManager retryContextManager,
                                        SFBaseSession sfSession)
                                 throws SnowflakeSQLException,
                                        IOException

Executes an HTTP request for Snowflake.

Parameters:
  `httpRequest` - HttpRequestBase
  `retryTimeout` - retry timeout
  `authTimeout` - authenticator timeout
  `socketTimeout` - socket timeout (in ms)
  `maxRetries` - retry count for the request
  `injectSocketTimeout` - injecting socket timeout
  `canceling` - canceling?
  `includeRetryParameters` - whether to include retry parameters in retried requests
  `retryOnHTTP403` - whether to retry on HTTP 403 or not
  `ocspAndProxyKey` - OCSP mode and proxy settings for httpclient
  `execTimeData` - query execution time telemetry data object
  `retryContextManager` - RetryContext used to customize retry handling functionality
  `sfSession` - the session associated with the request
Returns:
  response
Throws:
  `SnowflakeSQLException` - if Snowflake error occurs
  `IOException` - raises if a general IO error occurs