| Modifier and Type | Method and Description |
|---|---|
Config |
Config.addDefaultHeader(String name,
String value)
Add default header to appear on all requests
|
Config |
Config.addInterceptor(org.apache.http.HttpRequestInterceptor interceptor)
Add a HttpRequestInterceptor to the clients.
|
Config |
Config.asyncClient(AsyncClient value)
Set the full async configuration including monitors.
|
Config |
Config.asyncClient(java.util.function.Function<Config,AsyncClient> asyncClientBuilder)
Set the full async configuration including monitors.
|
Config |
Config.asyncClient(org.apache.http.nio.client.HttpAsyncClient value)
Set the asynchronous AbstractHttpAsyncClient implementation to use for every asynchronous request
|
Config |
Config.clearDefaultHeaders()
Clear default headers
|
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.connectTimeout(int inMillies)
Set the connection timeout
|
Config |
Config.enableCookieManagement(boolean enable)
Allow the client to manage cookies.
|
Config |
Config.followRedirects(boolean enable)
Allow the client to follow redirects.
|
Config |
Config.httpClient(Client httpClient)
Set the HttpClient implementation to use for every synchronous request
|
Config |
Config.httpClient(java.util.function.Function<Config,Client> httpClient)
Provide a builder for a client
|
Config |
Config.httpClient(org.apache.http.client.HttpClient httpClient)
Set the HttpClient implementation to use for every synchronous request
|
Config |
Config.proxy(org.apache.http.HttpHost 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.reset()
Shutdown the current config and re-init.
|
Config |
Config.setDefaultHeader(String name,
String value)
Set default header to appear on all requests
|
Config |
Config.setDefaultHeader(String name,
java.util.function.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.useSystemProperties(boolean value)
Tell the HttpClients to use the system properties for things like proxies
|
| Modifier and Type | Method and Description |
|---|---|
Config |
Config.asyncClient(java.util.function.Function<Config,AsyncClient> asyncClientBuilder)
Set the full async configuration including monitors.
|
Config |
Config.httpClient(java.util.function.Function<Config,Client> httpClient)
Provide a builder for a client
|
| Constructor and Description |
|---|
UnirestInstance(Config config) |
Copyright © 2019. All rights reserved.