net.snowflake.client.core

## Class HttpUtil

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

    public class HttpUtil
    extends Object

Created by jhuang on 1/19/16.

### Nested Class Summary

Nested Classes
`static class` `HttpUtil.HttpInputStream`

### Field Summary

Fields
`static int` `DEFAULT_CONNECTION_TIMEOUT`
`static int` `DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT`
`static int` `DEFAULT_MAX_CONNECTIONS`
`static int` `DEFAULT_MAX_CONNECTIONS_PER_ROUTE`

### Constructor Summary

Constructors
Constructor and Description
`HttpUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static org.apache.http.client.config.RequestConfig` `getDefaultRequestConfigWithSocketTimeout(int soTimeoutMs)` Return a request configuration inheriting from the default request configuration of the shared HttpClient with a different socket timeout.
`static org.apache.http.client.HttpClient` `getHttpClient()` Accessor for the HTTP client singleton.
`static String` `getHttpClientStats()` Accessor for the HTTP client singleton.

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

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

### Field Detail

#### DEFAULT_MAX_CONNECTIONS

    public static final int DEFAULT_MAX_CONNECTIONS

See Also:
  Constant Field Values

#### DEFAULT_MAX_CONNECTIONS_PER_ROUTE

    public static final int DEFAULT_MAX_CONNECTIONS_PER_ROUTE

See Also:
  Constant Field Values

#### DEFAULT_CONNECTION_TIMEOUT

    public static final int DEFAULT_CONNECTION_TIMEOUT

See Also:
  Constant Field Values

#### DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT

    public static final int DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT

See Also:
  Constant Field Values

### Constructor Detail

#### HttpUtil

    public HttpUtil()

### Method Detail

#### getHttpClient

    public static org.apache.http.client.HttpClient getHttpClient()

Accessor for the HTTP client singleton.

Returns:
  HttpClient object shared across all connections

#### getDefaultRequestConfigWithSocketTimeout

    public static final org.apache.http.client.config.RequestConfig getDefaultRequestConfigWithSocketTimeout(int soTimeoutMs)

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
Returns:
  RequestConfig object

#### getHttpClientStats

    public static String getHttpClientStats()

Accessor for the HTTP client singleton.

Returns:
  HTTP Client stats in string representation