Builder
- public interface ClientBuilderInterface<Builder>
Modifier and Type | Method and Description |
---|---|
Builder |
allowRedirects(boolean allowRedirects)
If follow get/head redirect, default true.
|
Builder |
auth(KeyCert cert)
秘钥认证
|
Builder |
auth(PasswordCert cert)
口令认证
|
Builder |
auth(String userName,
String password)
口令认证
|
Builder |
auth(String certPath,
String password,
String certType)
秘钥认证
|
Builder |
compress(boolean compress)
if send compress requests.
|
Builder |
connectTimeout(int timeout)
Set connect timeout in millis
|
Builder |
intercept(List<RequestInterceptor> interceptorList)
批量注册请求拦截器
|
Builder |
intercept(RequestInterceptor interceptor)
注册请求拦截器
|
Builder |
proxy(Proxy proxy)
代理
|
Builder |
proxy(String host,
int port)
无验证代理
|
Builder |
proxy(String host,
int port,
String proxyName,
String password)
带验证代理
|
Builder |
socketTimeout(int timeout)
Set socket timeout in millis
|
Builder |
timeout(int timeout)
Set socket timeout and connect timeout in millis
|
Builder |
timeToLive(long timeToLive)
how long http connection keep, in milliseconds.
|
Builder |
userAgent(String userAgent)
set userAgent
|
Builder |
verify(boolean verify)
if verify http certificate, default true
|
Builder timeToLive(long timeToLive)
Builder verify(boolean verify)
Builder allowRedirects(boolean allowRedirects)
allowPostRedirects
if you want thisBuilder compress(boolean compress)
Builder timeout(int timeout)
Builder socketTimeout(int timeout)
Builder connectTimeout(int timeout)
Builder proxy(String host, int port, String proxyName, String password)
host
- port
- proxyName
- password
- Builder auth(PasswordCert cert)
cert
- Builder auth(String certPath, String password, String certType)
certPath
- password
- certType
- Builder intercept(RequestInterceptor interceptor)
interceptor
- Builder intercept(List<RequestInterceptor> interceptorList)
interceptorList
- Copyright © 2006–2018 TinyGroup. All rights reserved.