public class OkHttpAsyncHttpClientBuilder extends Object
HttpClient for OkHttp.| Constructor and Description |
|---|
OkHttpAsyncHttpClientBuilder()
Creates OkHttpAsyncHttpClientBuilder.
|
OkHttpAsyncHttpClientBuilder(okhttp3.OkHttpClient okHttpClient)
Creates OkHttpAsyncHttpClientBuilder from the builder of an existing OkHttpClient.
|
| Modifier and Type | Method and Description |
|---|---|
OkHttpAsyncHttpClientBuilder |
addNetworkInterceptor(okhttp3.Interceptor networkInterceptor)
Add a network layer interceptor to Http request pipeline.
|
HttpClient |
build()
Build a HttpClient with current configurations.
|
OkHttpAsyncHttpClientBuilder |
configuration(Configuration configuration)
Sets the configuration store that is used during construction of the HTTP client.
|
OkHttpAsyncHttpClientBuilder |
connectionPool(okhttp3.ConnectionPool connectionPool)
Sets the Http connection pool.
|
OkHttpAsyncHttpClientBuilder |
connectionTimeout(Duration connectionTimeout)
Sets the connection timeout.
|
OkHttpAsyncHttpClientBuilder |
dispatcher(okhttp3.Dispatcher dispatcher)
Sets the dispatcher that also composes the thread pool for executing HTTP requests.
|
OkHttpAsyncHttpClientBuilder |
networkInterceptors(List<okhttp3.Interceptor> networkInterceptors)
Add network layer interceptors to Http request pipeline.
|
OkHttpAsyncHttpClientBuilder |
proxy(ProxyOptions proxyOptions)
Sets the proxy.
|
OkHttpAsyncHttpClientBuilder |
readTimeout(Duration readTimeout)
Sets the read timeout.
|
public OkHttpAsyncHttpClientBuilder()
public OkHttpAsyncHttpClientBuilder(okhttp3.OkHttpClient okHttpClient)
okHttpClient - the httpclientpublic OkHttpAsyncHttpClientBuilder addNetworkInterceptor(okhttp3.Interceptor networkInterceptor)
networkInterceptor - the interceptor to addpublic OkHttpAsyncHttpClientBuilder networkInterceptors(List<okhttp3.Interceptor> networkInterceptors)
networkInterceptors - the interceptors to addpublic OkHttpAsyncHttpClientBuilder readTimeout(Duration readTimeout)
readTimeout - the read timeoutpublic OkHttpAsyncHttpClientBuilder connectionTimeout(Duration connectionTimeout)
connectionTimeout - the connection timeoutpublic OkHttpAsyncHttpClientBuilder connectionPool(okhttp3.ConnectionPool connectionPool)
connectionPool - the OkHttp connection pool to usepublic OkHttpAsyncHttpClientBuilder dispatcher(okhttp3.Dispatcher dispatcher)
dispatcher - the dispatcher to usepublic OkHttpAsyncHttpClientBuilder proxy(ProxyOptions proxyOptions)
proxyOptions - The proxy configuration to use.OkHttpAsyncHttpClientBuilder objectpublic OkHttpAsyncHttpClientBuilder configuration(Configuration configuration)
The default configuration store is a clone of the global
configuration store, use Configuration.NONE to bypass using configuration settings during construction.
configuration - The configuration store used topublic HttpClient build()
HttpClient.Copyright © 2020 Microsoft Corporation. All rights reserved.