public interface IOkInit
| 限定符和类型 | 方法和说明 |
|---|---|
void |
judgeResultParseResponseFailed(Call call,
java.lang.String parseErrorResult,
java.lang.Exception e)
after judgeResultWhenFirstReceivedResponse
when parse JSON failed
|
int |
judgeResultWhenFirstReceivedResponse(Call call,
Response response,
JSONObject json)
the first time the response got from internet
0:RESULT_ERROR ;
1:RESULT_SUCCESS ;
-1:RESULT_VERIFY_ERROR;
2: RESULT_OTHER ;
at IOkResponse interface callback
|
void |
networkError(Call call,
boolean isCanceled)
no network or or call back cancel
|
void |
receivedNetworkErrorCode(Call call,
Response response)
after judgeResultWhenFirstReceivedResponse
result code not in [200...300)
|
boolean |
resultSuccessByJudge(Call call,
Response response,
JSONObject json,
int resultCode)
after judgeResultWhenFirstReceivedResponse
result is SUCCESS
returns ---
false: go on callbacks
true:interrupt callbacks
可在此方法保存资料到SQLite
|
Header |
setDefaultHeader(Header defaultHeader)
add defaultHeader in header
when new a request
|
Param |
setDefaultParams(Param defaultParams)
add defaultParams in param
when setFormBody requestBody
|
Param |
setParamsHeadersBeforeRequest(Param allParams,
Header header)
reset all Params in param
when setFormBody requestBody
|
int judgeResultWhenFirstReceivedResponse(Call call,
Response response,
JSONObject json)
call - response - json - void networkError(Call call,
boolean isCanceled)
call - isCanceled - void receivedNetworkErrorCode(Call call,
Response response)
call - response - boolean resultSuccessByJudge(Call call,
Response response,
JSONObject json,
int resultCode)
call - response - json - resultCode - void judgeResultParseResponseFailed(Call call,
java.lang.String parseErrorResult,
java.lang.Exception e)
call - parseErrorResult - Param setParamsHeadersBeforeRequest(Param allParams, Header header)
allParams - Param setDefaultParams(Param defaultParams)
defaultParams -