| Package | Description |
|---|---|
| kong.unirest | |
| kong.unirest.apache |
| Modifier and Type | Field and Description |
|---|---|
protected Config |
RawResponseBase.config |
| Modifier and Type | Method and Description |
|---|---|
Config |
Config.addDefaultCookie(Cookie cookie)
Adds a default cookie to be added to all requests with this config
|
Config |
Config.addDefaultCookie(String name,
String value)
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.addInterceptor(org.apache.http.HttpRequestInterceptor value)
Deprecated.
use the Unirest Interceptors rather than Apache
|
Config |
Config.addShutdownHook(boolean value)
Register the client with a system shutdown hook.
|
Config |
Config.asyncClient(AsyncClient value)
Set the full async configuration including monitors.
|
Config |
Config.asyncClient(Function<Config,AsyncClient> asyncClientBuilder)
Set the full async configuration including monitors.
|
Config |
Config.asyncClient(org.apache.http.nio.client.HttpAsyncClient value)
Deprecated.
use asyncClient(AsyncClient value)
|
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(KeyStore store,
String password)
Set a custom keystore
|
Config |
Config.clientCertificateStore(String fileLocation,
String password)
Set a custom keystore via a file path.
|
Config |
Config.concurrency(int total,
int perRoute)
Set the concurrency levels
|
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(Duration duration)
Sugar!
Total time to live (TTL) defines maximum life span of persistent connections regardless of their expiration setting.
|
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.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.errorHandler(Consumer<HttpResponse<?>> consumer)
Deprecated.
this is merging with the interceptor concept. see interceptor(Interceptor value)
|
Config |
Config.followRedirects(boolean enable)
Allow the client to follow redirects.
|
Config |
RawResponse.getConfig() |
Config |
RawResponseBase.getConfig() |
Config |
Config.hostnameVerifier(HostnameVerifier value)
Set a custom HostnameVerifier
|
Config |
Config.httpClient(Client httpClient)
Set the HttpClient implementation to use for every synchronous request
|
Config |
Config.httpClient(Function<Config,Client> httpClient)
Provide a builder for a client
|
Config |
Config.httpClient(org.apache.http.client.HttpClient httpClient)
Deprecated.
|
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(Proxy value)
Set a proxy
|
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.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.socketTimeout(int inMillies)
Set the socket timeout
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
default HttpResponse<?> |
Interceptor.onFail(Exception e,
HttpRequestSummary request,
Config config)
Called in the case of a total failure.
|
default void |
Interceptor.onRequest(HttpRequest<?> request,
Config config)
Called just before a request.
|
default void |
Interceptor.onResponse(HttpResponse<?> response,
HttpRequestSummary request,
Config config)
Called just after the request.
|
| Modifier and Type | Method and Description |
|---|---|
Config |
Config.asyncClient(Function<Config,AsyncClient> asyncClientBuilder)
Set the full async configuration including monitors.
|
Config |
Config.httpClient(Function<Config,Client> httpClient)
Provide a builder for a client
|
| Constructor and Description |
|---|
RawResponseBase(Config config) |
UnirestInstance(Config config)
Create a new UnirestInstance with a config
|
| Modifier and Type | Method and Description |
|---|---|
AsyncClient |
ApacheAsyncClient.Builder.apply(Config config) |
Client |
ApacheClient.Builder.apply(Config config) |
| Constructor and Description |
|---|
ApacheAsyncClient(Config config) |
ApacheAsyncClient(org.apache.http.nio.client.HttpAsyncClient client,
Config config) |
ApacheAsyncClient(org.apache.http.nio.client.HttpAsyncClient client,
Config config,
org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager manager,
AsyncIdleConnectionMonitorThread monitor)
Deprecated.
|
ApacheClient(Config config) |
ApacheClient(Config config,
Consumer<org.apache.http.impl.client.HttpClientBuilder> builderConfig) |
ApacheClient(org.apache.http.client.HttpClient httpClient,
Config config) |
ApacheClient(org.apache.http.client.HttpClient httpClient,
Config config,
org.apache.http.impl.conn.PoolingHttpClientConnectionManager clientManager)
Deprecated.
|
Copyright © 2021. All rights reserved.