I want to retry the request in my subscriber depends on the error which our server gave, but I need to modify the request info(headers and params) before retrying.how can I do?
ServerApi.login("103", "json", "379020", "银魂", "6")
.subscribe(new DialogSubscriber<String>(this, true) {
@Override
protected void onCCSuccess(String data) {
Toast.makeText(mActivity, "success", Toast.LENGTH_LONG).show();
}
@Override
protected void onFailed(int code, String message) {
if(code == RETRY_CODE){
retry();//modify this request params and headers and resend this request again
}else{
super.onFailed(code, message);
}
}
});
i want to do the retry in the subscriber's onFailed() method,please