public final class ImHttpClient extends Object
该类用于发送HTTP请求,而所有请求的数据都需要封装在ImRequest中,使用send方法发起请求
HTTP Client implementation class
This class is used to send HTTP requests, and all requested data needs to be encapsulated in the ImRequest, using the send method to initiate the request.
| 限定符和类型 | 方法和说明 |
|---|---|
static ImResponse |
send(ImRequest imRequest)
发起请求
Send Request
请注意,如果在ImRequest中指示为异步请求,那么此时返回的ImResponse将会是空值,需要在ImRequest中另行实现ImHttpCallback接口才能获得返回值
Note that if the asynchronous request is indicated in the ImRequest, then the ImResponse returned at this time will be null,
and the ImHttpCallback interface needs to be implemented separately in the ImRequest to get the return value.
|
static ImResponse |
send(ImRequest imRequest,
ImSession imSession)
发起一个带会话状态的请求
Send a request with a session state
请注意,如果在ImRequest中指示为异步请求,那么此时返回的ImResponse将会是空值,需要在ImRequest中另行实现ImHttpCallback接口才能获得返回值
Note that if the asynchronous request is indicated in the ImRequest, then the ImResponse returned at this time will be null,
and the ImHttpCallback interface needs to be implemented separately in the ImRequest to get the return value.
|
public static ImResponse send(ImRequest imRequest, ImSession imSession) throws SessionException, ContentTypeException, DataTypeException, MethodException, IgnoreSSLException, QueryParamsException, AuthenticationException, IOException
Send a request with a session state
请注意,如果在ImRequest中指示为异步请求,那么此时返回的ImResponse将会是空值,需要在ImRequest中另行实现ImHttpCallback接口才能获得返回值
Note that if the asynchronous request is indicated in the ImRequest, then the ImResponse returned at this time will be null, and the ImHttpCallback interface needs to be implemented separately in the ImRequest to get the return value.
imRequest - ImRequest会话请求数据 imSession - ImSession会话状态数据 SessionException - 会话状态控制相关异常/警告 ContentTypeException - 内容类型(ContentType)使用相关异常/警告 DataTypeException - 数据类型使用相关异常/警告 MethodException - 方法(Method)使用相关异常/警告 IgnoreSSLException - 忽略SSL相关异常/警告 QueryParamsException - 查询参数(QueryParams)相关异常/警告类 AuthenticationException - 身份认证相关异常/警告类 IOException - IO异常 ImRequest,
ImSessionpublic static ImResponse send(ImRequest imRequest) throws ContentTypeException, DataTypeException, MethodException, IgnoreSSLException, QueryParamsException, IOException
Send Request
请注意,如果在ImRequest中指示为异步请求,那么此时返回的ImResponse将会是空值,需要在ImRequest中另行实现ImHttpCallback接口才能获得返回值
Note that if the asynchronous request is indicated in the ImRequest, then the ImResponse returned at this time will be null, and the ImHttpCallback interface needs to be implemented separately in the ImRequest to get the return value.
imRequest - ImRequest会话请求数据 ContentTypeException - 内容类型(ContentType)使用相关异常/警告 DataTypeException - 数据类型使用相关异常/警告 MethodException - 方法(Method)使用相关异常/警告 IgnoreSSLException - 忽略SSL相关异常/警告 QueryParamsException - 查询参数(QueryParams)相关异常/警告类 IOException - IO异常 ImRequestCopyright © 2019. All rights reserved.