Config |
Config.addDefaultCookie(java.lang.String name,
java.lang.String value) |
Adds a default cookie to be added to all requests with this config
|
Config |
Config.addDefaultCookie(Cookie cookie) |
Adds a default cookie to be added to all requests with this config
|
Config |
Config.addDefaultHeader(java.lang.String name,
java.lang.String value) |
Add default header to appear on all requests
|
Config |
Config.cacheResponses(boolean value) |
Enable Response Caching with default options
|
Config |
Config.cacheResponses(Cache.Builder value) |
Enable Response Caching with custom options
|
Config |
Config.ciphers(java.lang.String... values) |
Set a custom array of ciphers
|
Config |
Config.clearDefaultHeaders() |
Clear default headers
|
Config |
Config.clientCertificateStore(java.lang.String fileLocation,
java.lang.String password) |
Set a custom keystore via a file path.
|
Config |
Config.clientCertificateStore(java.security.KeyStore store,
java.lang.String password) |
Set a custom keystore
|
static Config |
Unirest.config() |
Access the default configuration for the primary Unirest instance.
|
Config |
UnirestInstance.config() |
Access the default configuration for the primary Unirest instance.
|
Config |
Config.connectionTTL(long duration,
java.util.concurrent.TimeUnit unit) |
Sets the jdk.httpclient.keepalive.timeout setting
https://docs.oracle.com/en/java/javase/20/docs/api/java.net.http/module-summary.html
The number of seconds to keep idle HTTP connections alive in the keep alive cache.
|
Config |
Config.connectionTTL(java.time.Duration duration) |
Sets the jdk.httpclient.keepalive.timeout setting
https://docs.oracle.com/en/java/javase/20/docs/api/java.net.http/module-summary.html
The number of seconds to keep idle HTTP connections alive in the keep alive cache.
|
Config |
Config.connectTimeout(int inMillies) |
Set the connection timeout
|
Config |
Config.cookieSpec(java.lang.String policy) |
Sets a cookie policy
Acceptable values:
'default' (same as Netscape),
'netscape',
'ignoreCookies',
'standard' (RFC 6265 interoprability profile) ,
'standard-strict' (RFC 6265 strict profile)
|
Config |
Config.defaultBaseUrl(java.lang.String value) |
set a default base url for all routes.
|
Config |
Config.enableCookieManagement(boolean enable) |
Allow the client to manage cookies.
|
Config |
Config.executor(java.util.concurrent.Executor executor) |
Sets a custom executor for requests
|
Config |
Config.followRedirects(boolean enable) |
Allow the client to follow redirects.
|
Config |
MockRawResponse.getConfig() |
|
Config |
RawResponse.getConfig() |
Returns the current config for this request/response
|
Config |
RawResponseBase.getConfig() |
|
Config |
Config.httpClient(java.util.function.Function<Config,Client> httpClient) |
Provide a builder for a client
|
Config |
Config.httpClient(Client httpClient) |
Set the HttpClient implementation to use for every synchronous request
|
Config |
Config.instrumentWith(UniMetric metric) |
Add a metric object for instrumentation
|
Config |
Config.interceptor(Interceptor value) |
Add a Interceptor which will be called before and after the request;
|
Config |
Config.protocols(java.lang.String... values) |
Set a custom array of protocols
|
Config |
Config.proxy(java.lang.String host,
int port) |
Set a proxy
|
Config |
Config.proxy(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password) |
Set an authenticated proxy
|
Config |
Config.proxy(Proxy value) |
Set a proxy
|
Config |
Config.requestCompression(boolean value) |
Turn on or off requesting all content as compressed.
|
Config |
Config.reset() |
Shutdown the current config and re-init.
|
Config |
Config.retryAfter(boolean value) |
Automatically retry synchronous requests on 429/529 responses with the Retry-After response header
Default is false
|
Config |
Config.retryAfter(boolean value,
int maxRetryAttempts) |
Automatically retry synchronous requests on 429/529 responses with the Retry-After response header
Default is false
|
Config |
Config.retryAfter(RetryStrategy strategy) |
Automatically retry synchronous requests on 429/529 responses with the Retry-After response header
Default is false
|
Config |
Config.setDefaultBasicAuth(java.lang.String username,
java.lang.String password) |
Default basic auth credentials
|
Config |
Config.setDefaultHeader(java.lang.String name,
java.lang.String value) |
Set default header to appear on all requests
|
Config |
Config.setDefaultHeader(java.lang.String name,
java.util.function.Supplier<java.lang.String> value) |
Set default header to appear on all requests, value is through a Supplier
This is useful for adding tracing elements to requests.
|
Config |
Config.setDefaultResponseEncoding(java.lang.String value) |
Set the default encoding that will be used for serialization into Strings.
|
Config |
Config.setObjectMapper(ObjectMapper om) |
Set the ObjectMapper implementation to use for Response to Object binding
|
Config |
Config.sslContext(javax.net.ssl.SSLContext ssl) |
Set a custom SSLContext.
|
Config |
Config.useSystemProperties(boolean value) |
Tell the HttpClients to use the system properties for things like proxies
|
Config |
Config.verifySsl(boolean value) |
Toggle verifying SSL/TLS certificates.
|
Config |
Config.version(java.net.http.HttpClient.Version value) |
Requests a specific HTTP protocol version where possible.
|