| 程序包 | 说明 |
|---|---|
| cn.sinlmao.commons.network.callback | |
| cn.sinlmao.commons.network.http | |
| cn.sinlmao.commons.network.soap |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
ImHttpClientCallback.onComplete(ImRequest imRequest,
ImResponse imResponse)
HTTP请求完成时回调
仅在异步时才会执行
Callback when HTTP request is completed
Executed only when asynchronous
|
void |
ImHttpClientCallback.onSuccess(ImRequest imRequest,
ImResponse imResponse)
HTTP请求成功时回调
当前完成时指未发生任何错误时的完成,错误或异常的HTTP状态码(例如:404、500、401等)也会在此触发
仅在异步时才会执行
Callback when HTTP request succeeds
The current completion refers to the completion of any error, the error or abnormal HTTP status code (for example: 404, 500, 401, etc.) will also be triggered here.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected ImResponse |
ImResponse.addCookie(String name,
String data)
[内部] 添加Cookie数据
[Internal] Add cookie data
|
protected ImResponse |
ImResponse.addCookieProperty(ImResponseCookie imResponseCookie)
[内部] 添加Cookies属性数据
[Internal] Add cookie property data
|
static ImResponse |
ImHttpClient.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 |
ImHttpClient.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.
|
protected ImResponse |
ImResponse.setBytesContent(byte[] bytesContent)
[内部] 设置Response应答bytes消息
[Internal] Set Response Reply bytes message
|
protected ImResponse |
ImResponse.setFullCookie(String data)
[内部] 添加Cookie完整数据
[Internal] Add full data for cookies
|
protected ImResponse |
ImResponse.setFullHeaders(Map<String,List<String>> headers)
[内部] 添加Header完整数据
[Internal] Add Header full data
|
protected ImResponse |
ImResponse.setResponseCode(int responseCode)
[内部] 设置Response状态码
[Internal] Set the Response status code
|
protected ImResponse |
ImResponse.setResponseMessage(String responseMessage)
[内部] 设置Response状态消息
[Internal] Set the Response status message
|
protected ImResponse |
ImResponse.setStringContent(String stringContent)
[内部] 设置Response应答String消息
[Internal] Set Response Reply String Message
|
| 限定符和类型 | 方法和说明 |
|---|---|
static ImResponse |
ImHttpSoapClient.soap(ImHttpSoapRequest request)
发起SOAP协议消息请求
Initiate SOAP protocol message request
|
Copyright © 2020. All rights reserved.