Class OkHttpClient3Factory
- java.lang.Object
-
- com.foxinmy.weixin4j.http.factory.HttpClientFactory
-
- com.foxinmy.weixin4j.http.support.okhttp.OkHttpClient3Factory
-
public class OkHttpClient3Factory extends HttpClientFactory
使用OkHttp3- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.foxinmy.weixin4j.http.factory.HttpClientFactory
HttpClientFactory.AllowHostnameVerifier, HttpClientFactory.AllowX509TrustManager
-
-
Constructor Summary
Constructors Constructor Description OkHttpClient3Factory()
OkHttpClient3Factory(okhttp3.OkHttpClient.Builder clientBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OkHttpClient3Factory
addInterceptor(okhttp3.Interceptor interceptor)
HttpClient
newInstance(HttpParams params)
获取HttpClient实例OkHttpClient3Factory
retryOnConnectionFailure(boolean retryOnConnectionFailure)
OkHttpClient3Factory
setCache(okhttp3.Cache cache)
OkHttpClient3Factory
setConnectionPool(okhttp3.ConnectionPool connectionPool)
OkHttpClient3Factory
setCookieJar(okhttp3.CookieJar cookieJar)
OkHttpClient3Factory
setDispatcher(okhttp3.Dispatcher dispatcher)
OkHttpClient3Factory
setDns(okhttp3.Dns dns)
OkHttpClient3Factory
setWriteTimeout(int writeTimeout)
-
Methods inherited from class com.foxinmy.weixin4j.http.factory.HttpClientFactory
allowSSLContext, getDefaultFactory, getDefaultParams, getInstance, getInstance, setDefaultFactory, setDefaultParams
-
-
-
-
Method Detail
-
setWriteTimeout
public OkHttpClient3Factory setWriteTimeout(int writeTimeout)
-
addInterceptor
public OkHttpClient3Factory addInterceptor(okhttp3.Interceptor interceptor)
-
retryOnConnectionFailure
public OkHttpClient3Factory retryOnConnectionFailure(boolean retryOnConnectionFailure)
-
setCookieJar
public OkHttpClient3Factory setCookieJar(okhttp3.CookieJar cookieJar)
-
setCache
public OkHttpClient3Factory setCache(okhttp3.Cache cache)
-
setConnectionPool
public OkHttpClient3Factory setConnectionPool(okhttp3.ConnectionPool connectionPool)
-
setDispatcher
public OkHttpClient3Factory setDispatcher(okhttp3.Dispatcher dispatcher)
-
setDns
public OkHttpClient3Factory setDns(okhttp3.Dns dns)
-
newInstance
public HttpClient newInstance(HttpParams params)
Description copied from class:HttpClientFactory
获取HttpClient实例- Specified by:
newInstance
in classHttpClientFactory
- Parameters:
params
- http参数 可为空- Returns:
-
-