| 程序包 | 说明 |
|---|---|
| cn.sinlmao.commons.network.callback | |
| cn.sinlmao.commons.network.http |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
ImSessionCallback.doAuthentication(ImSession imSession,
ImRequest imRequest)
执行身份认证的业务回调
当配置会话状态需要身份认证后且未具备身份认证时,才会执行此回调
Business callback for identity authentication
This callback is executed when the configuration session state requires authentication and does not have authentication.
|
boolean |
ImSessionCallback.isAuthentication(ImSession imSession,
ImRequest imRequest)
确定是否具备身份认证的业务回调
当配置会话状态需要身份认证后,才会执行此回调
Determine if there is a business callback with authentication
This callback is only executed when the session state needs to be authenticated.
|
void |
ImSessionCallback.onError(ImSession imSession,
ImRequest imRequest,
Throwable throwable)
执行时发生错误的回调
仅在异步时才会执行
An error callback occurred during execution
Executed only when asynchronous
|
| 限定符和类型 | 方法和说明 |
|---|---|
ImSession |
ImSession.addCookie(com.alibaba.fastjson.JSONObject cookies)
添加Cookie,当数据已经存在,则不再添加
Add a Cookie, when the data already exists, it will not be added
|
ImSession |
ImSession.addCookie(Map<String,String> cookies)
添加Cookie,当数据已经存在,则不再添加
Add a Cookie, when the data already exists, it will not be added
|
ImSession |
ImSession.addCookie(String name,
String value)
添加Cookie,当数据已经存在,则不再添加
Add a Cookie, when the data already exists, it will not be added
|
ImSession |
ImSession.addExtra(com.alibaba.fastjson.JSONObject extras)
添加Extra(额外/附加)数据,当数据已经存在,则不再添加
Add Extra (extra/additional) data, when the data already exists, it will not be added
|
ImSession |
ImSession.addExtra(Map<String,Object> extras)
添加Extra(额外/附加)数据,当数据已经存在,则不再添加
Add Extra (extra/additional) data, when the data already exists, it will not be added
|
ImSession |
ImSession.addExtra(String name,
Object value)
添加Extra(额外/附加)数据,当数据已经存在,则不再添加
Add Extra (extra/additional) data, when the data already exists, it will not be added
|
ImSession |
ImSession.addHeader(com.alibaba.fastjson.JSONObject headers)
添加Header,当数据已经存在,则不再添加
Add a Header, when the data already exists, it will not be added
|
ImSession |
ImSession.addHeader(Map<String,String> headers)
添加Header,当数据已经存在,则不再添加
Add a Header, when the data already exists, it will not be added
|
ImSession |
ImSession.addHeader(String name,
String value)
添加Header,当数据已经存在,则不再添加
Add a Header, when the data already exists, it will not be added
|
ImSession |
ImSession.setAutoAuthentication(boolean autoAuthentication)
设置是否需要自动处理身份认证
当设置该标记后,还需要设置NeedAuthentication和ImSessionCallback,否则该项不会生效
Set the need to automatically handle identity authentication
After setting this flag, you need to set NeedAuthentication and ImSessionCallback, otherwise the item will not take effect.
|
ImSession |
ImSession.setAutoAuthenticationTryCount(int autoAuthenticationTryCount)
设置自动处理身份认证时最大次数(最小1次,最大5次)
当设置该值后,还需要设置NeedAuthentication、AutoAuthentication和ImSessionCallback,否则该项不会生效
Set the maximum number of automatic processing of identity authentication (minimum 1 time, maximum 5 times)
After setting this value, you also need to set NeedAuthentication, AutoAuthentication and ImSessionCallback, otherwise the item will not take effect.
|
ImSession |
ImSession.setCookie(com.alibaba.fastjson.JSONObject cookies)
添加Cookie,当数据已经存在,则以最后设置的为准
Set the Cookie.
|
ImSession |
ImSession.setCookie(Map<String,String> cookies)
添加Cookie,当数据已经存在,则以最后设置的为准
Set the Cookie.
|
ImSession |
ImSession.setCookie(String name,
String value)
添加Cookie,当数据已经存在,则以最后设置的为准
Set the Cookie.
|
ImSession |
ImSession.setExtra(com.alibaba.fastjson.JSONObject extras)
设置Extra(额外/附加)数据,当数据已经存在,则以最后设置的为准
Set the Extra (extra/additional) data.
|
ImSession |
ImSession.setExtra(Map<String,Object> extras)
设置Extra(额外/附加)数据,当数据已经存在,则以最后设置的为准
Set the Extra (extra/additional) data.
|
ImSession |
ImSession.setExtra(String name,
Object value)
设置Extra(额外/附加)数据,当数据已经存在,则以最后设置的为准
Set the Extra (extra/additional) data.
|
ImSession |
ImSession.setHeader(com.alibaba.fastjson.JSONObject headers)
设置Header,当数据已经存在,则以最后设置的为准
Set the Header.
|
ImSession |
ImSession.setHeader(Map<String,String> headers)
设置Header,当数据已经存在,则以最后设置的为准
Set the Header.
|
ImSession |
ImSession.setHeader(String name,
String value)
设置Header,当数据已经存在,则以最后设置的为准
Set the Header.
|
ImSession |
ImSession.setNeedAuthentication(boolean needAuthentication)
设置是否需要身份认证
当设置该标记后,还需要设置ImSessionCallback,否则该项不会生效
Set whether authentication is required
After setting this flag, you also need to set ImSessionCallback, otherwise the item will not take effect.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
Copyright © 2020. All rights reserved.