@ConfigurationProperties(prefix="ms.network.okhttp") public class OkHttpProperties extends Object
| 构造器和说明 |
|---|
OkHttpProperties() |
OkHttpProperties(Integer connectTimeout,
Integer readTimeout,
Integer writeTimeout,
Boolean followRedirects,
Boolean retryOnConnectionFailure)
初始化
|
public OkHttpProperties()
public OkHttpProperties(Integer connectTimeout, Integer readTimeout, Integer writeTimeout, Boolean followRedirects, Boolean retryOnConnectionFailure)
connectTimeout - 连接超时时间 s秒readTimeout - 读取超时时间 s秒writeTimeout - 写入超时时间 s秒followRedirects - 是否自动重定向retryOnConnectionFailure - 是否开启重试public static OkHttpProperties closeLog()
public static OkHttpProperties closeCache()
public static OkHttpProperties closeConnectionPool()
public static OkHttpProperties openProxy(String host, int port)
public static OkHttpProperties openProxy(Proxy.Type type, String host, int port)
public static OkHttpProperties openDns()
public static OkHttpProperties openDns(String... dns)
public static OkHttpProperties openThreadPool(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit)
public Proxy getProxy()
public okhttp3.Authenticator getProxyAuthenticator()
public okhttp3.Dns getDns()
public OkHttpProperties setProxy(String host, int port)
public Integer getConnectTimeout()
public Integer getReadTimeout()
public Integer getWriteTimeout()
public Boolean getFollowRedirects()
public Boolean getRetryOnConnectionFailure()
public Boolean getConnectionPoolEnable()
public Integer getMaxIdleConnections()
public Long getKeepAliveDuration()
public Boolean getCacheEnable()
public Long getCacheSize()
public String getCachePath()
public Boolean getProxyEnable()
public String getProxyType()
public void setProxyType(Proxy.Type proxyType)
public String getProxyHost()
public Integer getProxyPort()
public String getProxyUsername()
public String getProxyPassword()
public Boolean getDnsEnable()
public Boolean getLogEnable()
public String getLogLevel()
public TimeUnit getKeepAliveDurationTimeUnit()
Copyright © 2024. All rights reserved.