接口 SuccessWhen

所有已知实现类:
DefaultSuccessWhen
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface SuccessWhen
回调函数: 请求是否成功

该回调函数用于判断请求是否成功

如果成功, 执行 onSuccess

如果失败, 执行 onError

从以下版本开始:
1.5.2
作者:
gongjun [dt_flys@hotmail.com]
  • 方法详细资料

    • successWhen

      boolean successWhen(ForestRequest req, ForestResponse res)
      回调函数: 请求是否成功

      该回调函数用于判断请求是否成功

      如果成功, 执行 onSuccess

      如果失败, 执行 onError

      参数:
      req - Forest请求对象
      res - Forest响应对象
      返回:
      true: 请求成功, false: 请求失败