com.foxinmy.weixin4j.http.support.okhttp
Class OkHttpClient3Factory

java.lang.Object
  extended by com.foxinmy.weixin4j.http.factory.HttpClientFactory
      extended by 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
OkHttpClient3Factory()
           
OkHttpClient3Factory(okhttp3.OkHttpClient.Builder clientBuilder)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OkHttpClient3Factory

public OkHttpClient3Factory()

OkHttpClient3Factory

public OkHttpClient3Factory(okhttp3.OkHttpClient.Builder clientBuilder)
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 class HttpClientFactory
Parameters:
params - http参数 可为空
Returns:


Copyright © 2014–2017. All rights reserved.