public interface Request<Req extends Request<Req>>
| 限定符和类型 | 方法和说明 |
|---|---|
Req |
connectTimeout(int connectTimeout)
为构建本次Request设置单独连接超时时间
|
HttpResponse |
execute()
执行HTTP请求
|
void |
execute(HttpCallBack callBack)
异步执行HTTP请求
|
Req |
header(java.lang.String key,
java.lang.String value)
添加请求头信息
|
Req |
maxRetry(int maxRetry)
失败最大重试次数
|
Req |
readTimeout(int readTimeout)
为构建本次Request设置单独读取流超时。
|
Req |
removeHeader(java.lang.String key)
从请求头中移除键值
|
Req |
writeTimeout(int writeTimeout)
为构建本次Request设置单独写入流超时。
|
Req header(java.lang.String key, java.lang.String value)
key - 请求头键名value - 请求头值Req removeHeader(java.lang.String key)
key - 请求头键名Req connectTimeout(int connectTimeout)
connectTimeout - 连接超时时间,单位秒Req readTimeout(int readTimeout)
readTimeout - 流读取超时时间,单位秒Req writeTimeout(int writeTimeout)
writeTimeout - 流写入超时时间,单位秒Req maxRetry(int maxRetry)
maxRetry - HttpResponse execute()
void execute(HttpCallBack callBack)
callBack - 回调函数Copyright © 2020. All Rights Reserved.