IDoxNextMiddleware class abstract
A class middleware that runs code before and after the controller.
Call Next to run the rest of the middleware and the controller. Change the response it gives, then return it. Return something else without calling Next to stop early.
class SeeOther implements IDoxNextMiddleware {
@override
Future<DoxResponse> handle(DoxRequest req, Next next) async {
DoxResponse res = await next();
if (res.status == 302 && req.method != 'GET') res.statusCode(303);
return res;
}
}
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
handle(
DoxRequest req, Next next) → FutureOr -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited