public interface XHttpExecutor
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
XHttpExecutor.Content
HTTP请求体,需要提供请求体的类型、请求体的长度、请求体写出到输出流的方法
|
static interface |
XHttpExecutor.Interceptor
http拦截器,能够拦截http执行器执行的每个请求。
|
static class |
XHttpExecutor.KeyValue
键值对
|
static interface |
XHttpExecutor.Request
http请求
|
static interface |
XHttpExecutor.Response
http响应
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addCookie(URI uri,
HttpCookie cookie)
添加cookie
|
XHttpExecutor.Response |
execute(XHttpExecutor.Request request)
执行http请求
|
int |
getConnectTimeout()
获取连接超时时间
|
List<HttpCookie> |
getCookies()
获取所有cookie
|
List<HttpCookie> |
getCookies(URI uri)
获取cookie
|
XHttpExecutor.Interceptor[] |
getInterceptors()
获取请求拦截器
|
int |
getReadTimeout()
获取读取超时时间
|
void |
rmvCookies()
删除所有cookie
|
void |
rmvCookies(URI uri,
HttpCookie cookie)
删除cookie信息
|
void |
setConnectTimeout(int timeout)
设置连接超时时间
|
void |
setInterceptors(XHttpExecutor.Interceptor... interceptors)
设置请求拦截器
|
void |
setReadTimeout(int timeout)
设置读取超时时间
|
void setConnectTimeout(int timeout)
timeout - 连接超时时间int getConnectTimeout()
void setReadTimeout(int timeout)
timeout - 读取超时时间int getReadTimeout()
void addCookie(URI uri, HttpCookie cookie)
uri - cookie的uricookie - cookie信息List<HttpCookie> getCookies(URI uri)
uri - cookie的uriList<HttpCookie> getCookies()
void rmvCookies(URI uri, HttpCookie cookie)
uri - cookie的uricookie - cookie信息void rmvCookies()
void setInterceptors(XHttpExecutor.Interceptor... interceptors)
interceptors - 拦截器XHttpExecutor.Interceptor[] getInterceptors()
XHttpExecutor.Response execute(XHttpExecutor.Request request) throws Exception
request - 请求参数Exception - 请求过程中可能会发生异常Copyright © 2019. All rights reserved.