Config |
Config.addDefaultCookie(String name,
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(String name,
String value) |
Add default header to appear on all requests
|
Config |
Config.automaticRetries(boolean value) |
Automaticly retry certain recoverable errors like socket timeouts.
|
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(String... values) |
Set a custom array of ciphers
|
Config |
Config.clearDefaultHeaders() |
Clear default headers
|
Config |
Config.clientCertificateStore(String fileLocation,
String password) |
Set a custom keystore via a file path.
|
Config |
Config.clientCertificateStore(KeyStore store,
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,
TimeUnit unit) |
Total time to live (TTL) defines maximum life span of persistent connections regardless of their expiration setting.
|
Config |
Config.connectionTTL(Duration duration) |
Sugar!
Total time to live (TTL) defines maximum life span of persistent connections regardless of their expiration setting.
|
Config |
Config.connectTimeout(int inMillies) |
Set the connection timeout
|
Config |
Config.cookieSpec(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(String value) |
set a default base url for all routes.
|
Config |
Config.enableCookieManagement(boolean enable) |
Allow the client to manage cookies.
|
Config |
Config.executor(Executor executor) |
Sets a custom executor for requests
|
Config |
Config.followRedirects(boolean enable) |
Allow the client to follow redirects.
|
Config |
RawResponse.getConfig() |
|
Config |
RawResponseBase.getConfig() |
|
Config |
Config.httpClient(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(String... values) |
Set a custom array of protocols
|
Config |
Config.proxy(String host,
int port) |
Set a proxy
|
Config |
Config.proxy(String host,
int port,
String username,
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.setDefaultBasicAuth(String username,
String password) |
Default basic auth credentials
|
Config |
Config.setDefaultHeader(String name,
String value) |
Set default header to appear on all requests
|
Config |
Config.setDefaultHeader(String name,
Supplier<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(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(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(HttpClient.Version value) |
Requests a specific HTTP protocol version where possible.
|