类的使用
com.lark.oapi.okhttp.OkHttpClient.Builder
使用OkHttpClient.Builder的程序包
-
com.lark.oapi.okhttp中OkHttpClient.Builder的使用
修饰符和类型方法说明OkHttpClient.Builder.addInterceptor(Interceptor interceptor) OkHttpClient.Builder.addNetworkInterceptor(Interceptor interceptor) OkHttpClient.Builder.authenticator(Authenticator authenticator) Sets the authenticator used to respond to challenges from origin servers.Sets the response cache to be used to read and write cached responses.OkHttpClient.Builder.callTimeout(long timeout, TimeUnit unit) Sets the default timeout for complete calls.OkHttpClient.Builder.callTimeout(Duration duration) Sets the default timeout for complete calls.OkHttpClient.Builder.certificatePinner(CertificatePinner certificatePinner) Sets the certificate pinner that constrains which certificates are trusted.OkHttpClient.Builder.connectionPool(ConnectionPool connectionPool) Sets the connection pool used to recycle HTTP and HTTPS connections.OkHttpClient.Builder.connectionSpecs(List<ConnectionSpec> connectionSpecs) OkHttpClient.Builder.connectTimeout(long timeout, TimeUnit unit) Sets the default connect timeout for new connections.OkHttpClient.Builder.connectTimeout(Duration duration) Sets the default connect timeout for new connections.Sets the handler that can accept cookies from incoming HTTP responses and provides cookies to outgoing HTTP requests.OkHttpClient.Builder.dispatcher(Dispatcher dispatcher) Sets the dispatcher used to set policy and execute asynchronous requests.Sets the DNS service used to lookup IP addresses for hostnames.OkHttpClient.Builder.eventListener(EventListener eventListener) Configure a single client scoped listener that will receive all analytic events for this client.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.followRedirects(boolean followRedirects) Configure this client to follow redirects.OkHttpClient.Builder.followSslRedirects(boolean followProtocolRedirects) Configure this client to follow redirects from HTTPS to HTTP and from HTTP to HTTPS.OkHttpClient.Builder.hostnameVerifier(HostnameVerifier hostnameVerifier) Sets the verifier used to confirm that response certificates apply to requested hostnames for HTTPS connections.OkHttpClient.newBuilder()OkHttpClient.Builder.pingInterval(long interval, TimeUnit unit) Sets the interval between HTTP/2 and web socket pings initiated by this client.OkHttpClient.Builder.pingInterval(Duration duration) Sets the interval between HTTP/2 and web socket pings initiated by this client.Configure the protocols used by this client to communicate with remote servers.Sets the HTTP proxy that will be used by connections created by this client.OkHttpClient.Builder.proxyAuthenticator(Authenticator proxyAuthenticator) Sets the authenticator used to respond to challenges from proxy servers.OkHttpClient.Builder.proxySelector(ProxySelector proxySelector) Sets the proxy selection policy to be used if noproxyis specified explicitly.OkHttpClient.Builder.readTimeout(long timeout, TimeUnit unit) Sets the default read timeout for new connections.OkHttpClient.Builder.readTimeout(Duration duration) Sets the default read timeout for new connections.OkHttpClient.Builder.retryOnConnectionFailure(boolean retryOnConnectionFailure) Configure this client to retry or not when a connectivity problem is encountered.OkHttpClient.Builder.socketFactory(SocketFactory socketFactory) Sets the socket factory used to create connections.OkHttpClient.Builder.sslSocketFactory(SSLSocketFactory sslSocketFactory) 已过时。OkHttpClient.Builder.sslSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager) Sets the socket factory and trust manager used to secure HTTPS connections.OkHttpClient.Builder.writeTimeout(long timeout, TimeUnit unit) Sets the default write timeout for new connections.OkHttpClient.Builder.writeTimeout(Duration duration) Sets the default write timeout for new connections.
SSLSocketFactorydoes not expose itsX509TrustManager, which is a field that OkHttp needs to build a clean certificate chain.