Modifier and Type | Method and Description |
---|---|
OkHttpClient.Builder |
OkHttpClient.Builder.addInterceptor(Interceptor interceptor) |
OkHttpClient.Builder |
OkHttpClient.Builder.addNetworkInterceptor(Interceptor interceptor) |
OkHttpClient.Builder |
OkHttpClient.Builder.authenticator(Authenticator authenticator)
Sets the authenticator used to respond to challenges from origin servers.
|
OkHttpClient.Builder |
OkHttpClient.Builder.cache(Cache cache)
Sets the response cache to be used to read and write cached responses.
|
OkHttpClient.Builder |
OkHttpClient.Builder.callTimeout(Duration duration)
Sets the default timeout for complete calls.
|
OkHttpClient.Builder |
OkHttpClient.Builder.callTimeout(long timeout,
TimeUnit unit)
Sets the default timeout for complete calls.
|
OkHttpClient.Builder |
OkHttpClient.Builder.certificatePinner(CertificatePinner certificatePinner)
Sets the certificate pinner that constrains which certificates are trusted.
|
OkHttpClient.Builder |
OkHttpClient.Builder.connectionPool(ConnectionPool connectionPool)
Sets the connection pool used to recycle HTTP and HTTPS connections.
|
OkHttpClient.Builder |
OkHttpClient.Builder.connectionSpecs(List<ConnectionSpec> connectionSpecs) |
OkHttpClient.Builder |
OkHttpClient.Builder.connectTimeout(Duration duration)
Sets the default connect timeout for new connections.
|
OkHttpClient.Builder |
OkHttpClient.Builder.connectTimeout(long timeout,
TimeUnit unit)
Sets the default connect timeout for new connections.
|
OkHttpClient.Builder |
OkHttpClient.Builder.cookieJar(CookieJar cookieJar)
Sets the handler that can accept cookies from incoming HTTP responses and provides cookies to
outgoing HTTP requests.
|
OkHttpClient.Builder |
OkHttpClient.Builder.dispatcher(Dispatcher dispatcher)
Sets the dispatcher used to set policy and execute asynchronous requests.
|
OkHttpClient.Builder |
OkHttpClient.Builder.dns(Dns dns)
Sets the DNS service used to lookup IP addresses for hostnames.
|
OkHttpClient.Builder |
OkHttpClient.Builder.eventListener(EventListener eventListener)
Configure a single client scoped listener that will receive all analytic events
for this client.
|
OkHttpClient.Builder |
OkHttpClient.Builder.eventListenerFactory(EventListener.Factory eventListenerFactory)
Configure a factory to provide per-call scoped listeners that will receive analytic events
for this client.
|
OkHttpClient.Builder |
OkHttpClient.Builder.followRedirects(boolean followRedirects)
Configure this client to follow redirects.
|
OkHttpClient.Builder |
OkHttpClient.Builder.followSslRedirects(boolean followProtocolRedirects)
Configure this client to follow redirects from HTTPS to HTTP and from HTTP to HTTPS.
|
OkHttpClient.Builder |
OkHttpClient.Builder.hostnameVerifier(HostnameVerifier hostnameVerifier)
Sets the verifier used to confirm that response certificates apply to requested hostnames for
HTTPS connections.
|
OkHttpClient.Builder |
OkHttpClient.newBuilder() |
OkHttpClient.Builder |
OkHttpClient.Builder.pingInterval(Duration duration)
Sets the interval between HTTP/2 and web socket pings initiated by this client.
|
OkHttpClient.Builder |
OkHttpClient.Builder.pingInterval(long interval,
TimeUnit unit)
Sets the interval between HTTP/2 and web socket pings initiated by this client.
|
OkHttpClient.Builder |
OkHttpClient.Builder.protocols(List<Protocol> protocols)
Configure the protocols used by this client to communicate with remote servers.
|
OkHttpClient.Builder |
OkHttpClient.Builder.proxy(Proxy proxy)
Sets the HTTP proxy that will be used by connections created by this client.
|
OkHttpClient.Builder |
OkHttpClient.Builder.proxyAuthenticator(Authenticator proxyAuthenticator)
Sets the authenticator used to respond to challenges from proxy servers.
|
OkHttpClient.Builder |
OkHttpClient.Builder.proxySelector(ProxySelector proxySelector)
Sets the proxy selection policy to be used if no
proxy is specified
explicitly. |
OkHttpClient.Builder |
OkHttpClient.Builder.readTimeout(Duration duration)
Sets the default read timeout for new connections.
|
OkHttpClient.Builder |
OkHttpClient.Builder.readTimeout(long timeout,
TimeUnit unit)
Sets the default read timeout for new connections.
|
OkHttpClient.Builder |
OkHttpClient.Builder.retryOnConnectionFailure(boolean retryOnConnectionFailure)
Configure this client to retry or not when a connectivity problem is encountered.
|
OkHttpClient.Builder |
OkHttpClient.Builder.socketFactory(SocketFactory socketFactory)
Sets the socket factory used to create connections.
|
OkHttpClient.Builder |
OkHttpClient.Builder.sslSocketFactory(SSLSocketFactory sslSocketFactory)
Deprecated.
SSLSocketFactory does not expose its X509TrustManager , which is
a field that OkHttp needs to build a clean certificate chain. This method instead must
use reflection to extract the trust manager. Applications should prefer to call sslSocketFactory(SSLSocketFactory, X509TrustManager) , which avoids such reflection. |
OkHttpClient.Builder |
OkHttpClient.Builder.sslSocketFactory(SSLSocketFactory sslSocketFactory,
X509TrustManager trustManager)
Sets the socket factory and trust manager used to secure HTTPS connections.
|
OkHttpClient.Builder |
OkHttpClient.Builder.writeTimeout(Duration duration)
Sets the default write timeout for new connections.
|
OkHttpClient.Builder |
OkHttpClient.Builder.writeTimeout(long timeout,
TimeUnit unit)
Sets the default write timeout for new connections.
|
Copyright © 2019. All rights reserved.