Package com.ibm.cloud.sdk.core.http
Class HttpConfigOptions.Builder
- java.lang.Object
-
- com.ibm.cloud.sdk.core.http.HttpConfigOptions.Builder
-
- Enclosing class:
- HttpConfigOptions
public static class HttpConfigOptions.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HttpConfigOptions
build()
HttpConfigOptions.Builder
disableRetries()
Sets the retry specific parameter to zero to disable the retry functionality.HttpConfigOptions.Builder
disableSslVerification(boolean disableSslVerification)
Sets flag to disable any SSL certificate verification during HTTP requests.HttpConfigOptions.Builder
enableGzipCompression(java.lang.Boolean enableGzipCompression)
Sets flag to enable gzip compression of request bodies during HTTP requests.HttpConfigOptions.Builder
enableRateLimitRetry(Authenticator authenticator, int defaultInterval, int maxRetries)
Deprecated.As of 9.13.0, use the HttpConfigOptions.enableRetries() instead.HttpConfigOptions.Builder
enableRetries(Authenticator authenticator, int maxRetries, int maxRetryInterval)
Sets retry specific parameters to enable it.HttpConfigOptions.Builder
loggingLevel(HttpConfigOptions.LoggingLevel loggingLevel)
Sets HTTP logging level to be used by the current client.HttpConfigOptions.Builder
proxy(java.net.Proxy proxy)
Sets HTTP proxy to be used by connections with the current client.HttpConfigOptions.Builder
proxyAuthenticator(okhttp3.Authenticator proxyAuthenticator)
Sets HTTP proxy authentication to be used by connections with the current client.
-
-
-
Method Detail
-
build
public HttpConfigOptions build()
-
disableSslVerification
public HttpConfigOptions.Builder disableSslVerification(boolean disableSslVerification)
Sets flag to disable any SSL certificate verification during HTTP requests. This should ONLY be used if truly intended, as it's unsafe otherwise.- Parameters:
disableSslVerification
- whether to disable SSL verification or not- Returns:
- the builder
-
enableGzipCompression
public HttpConfigOptions.Builder enableGzipCompression(java.lang.Boolean enableGzipCompression)
Sets flag to enable gzip compression of request bodies during HTTP requests. This should ONLY be used if truly intended, as many webservers can't handle this.- Parameters:
enableGzipCompression
- whether to disable SSL verification or not- Returns:
- the builder
-
enableRateLimitRetry
@Deprecated public HttpConfigOptions.Builder enableRateLimitRetry(Authenticator authenticator, int defaultInterval, int maxRetries)
Deprecated.As of 9.13.0, use the HttpConfigOptions.enableRetries() instead.Sets retry on rate limiting policy (429). SeeRateLimitConstants
for defaults to use- Parameters:
authenticator
- to use for retries, theAuthenticator
used by the clientdefaultInterval
- if not specified in the response, how long to wait until the next attemptmaxRetries
- the maximum amount of retries for an request- Returns:
- the builder
-
enableRetries
public HttpConfigOptions.Builder enableRetries(Authenticator authenticator, int maxRetries, int maxRetryInterval)
Sets retry specific parameters to enable it.- Parameters:
authenticator
- to use for retries, theAuthenticator
used by the clientmaxRetries
- the maximum amount of retries for a requestmaxRetryInterval
- if not specified in the response, how long to wait until the next attempt- Returns:
- the builder
-
disableRetries
public HttpConfigOptions.Builder disableRetries()
Sets the retry specific parameter to zero to disable the retry functionality.- Returns:
- the builder
-
proxy
public HttpConfigOptions.Builder proxy(java.net.Proxy proxy)
Sets HTTP proxy to be used by connections with the current client.- Parameters:
proxy
- the desiredProxy
- Returns:
- the builder
-
proxyAuthenticator
public HttpConfigOptions.Builder proxyAuthenticator(okhttp3.Authenticator proxyAuthenticator)
Sets HTTP proxy authentication to be used by connections with the current client.- Parameters:
proxyAuthenticator
- the desiredAuthenticator
- Returns:
- the builder
-
loggingLevel
public HttpConfigOptions.Builder loggingLevel(HttpConfigOptions.LoggingLevel loggingLevel)
Sets HTTP logging level to be used by the current client.- Parameters:
loggingLevel
- theHttpConfigOptions.LoggingLevel
specifying how much information should be logged- Returns:
- the builder
-
-