Class OkHttpClient2Factory
- java.lang.Object
-
- com.foxinmy.weixin4j.http.factory.HttpClientFactory
-
- com.foxinmy.weixin4j.http.support.okhttp.OkHttpClient2Factory
-
public class OkHttpClient2Factory extends HttpClientFactory
使用OkHttp2- 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 OkHttpClient2Factory()
OkHttpClient2Factory(com.squareup.okhttp.OkHttpClient okClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpClient
newInstance(HttpParams params)
获取HttpClient实例OkHttpClient2Factory
setCache(com.squareup.okhttp.Cache cache)
OkHttpClient2Factory
setConnectionPool(com.squareup.okhttp.ConnectionPool connectionPool)
OkHttpClient2Factory
setCookieHandler(CookieHandler cookieHandler)
OkHttpClient2Factory
setDispatcher(com.squareup.okhttp.Dispatcher dispatcher)
OkHttpClient2Factory
setDns(com.squareup.okhttp.Dns dns)
OkHttpClient2Factory
setWriteTimeout(int writeTimeout)
-
Methods inherited from class com.foxinmy.weixin4j.http.factory.HttpClientFactory
allowSSLContext, getDefaultFactory, getDefaultParams, getInstance, getInstance, setDefaultFactory, setDefaultParams
-
-
-
-
Method Detail
-
setWriteTimeout
public OkHttpClient2Factory setWriteTimeout(int writeTimeout)
-
setCache
public OkHttpClient2Factory setCache(com.squareup.okhttp.Cache cache)
-
setConnectionPool
public OkHttpClient2Factory setConnectionPool(com.squareup.okhttp.ConnectionPool connectionPool)
-
setCookieHandler
public OkHttpClient2Factory setCookieHandler(CookieHandler cookieHandler)
-
setDispatcher
public OkHttpClient2Factory setDispatcher(com.squareup.okhttp.Dispatcher dispatcher)
-
setDns
public OkHttpClient2Factory setDns(com.squareup.okhttp.Dns dns)
-
newInstance
public HttpClient newInstance(HttpParams params)
Description copied from class:HttpClientFactory
获取HttpClient实例- Specified by:
newInstance
in classHttpClientFactory
- Parameters:
params
- http参数 可为空- Returns:
-
-