Middleware class abstract
中间件抽象接口
定义请求生命周期的 5 个钩子方法。 继承此类并覆盖需要的方法来实现自定义逻辑。
- Implementers
Constructors
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onError(
RequestContext ctx, SmartError error) → Future< void> - 错误发生时调用
-
onFinish(
RequestContext ctx) → Future< void> - 请求结束后调用(无论成功失败都会执行)
-
onRequest(
RequestContext ctx, RequestOptions options) → Future< void> - 请求发送前调用(可修改 RequestOptions)
-
onResponse(
RequestContext ctx, Response response) → Future< void> - 响应接收后调用
-
onStart(
RequestContext ctx) → Future< void> - 请求开始前调用
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited