RequestController class

Base type that processes Requests.

Instances of this type process requests by creating a Response or passing the Request to nextController. The nextController is set at startup in RequestSink.setupRouter via pipe, generate, or listen.

This class is intended to be subclassed. RequestSink, Router, HTTPController are all examples of this type. Subclasses should implement processRequest to respond to, modify or forward requests.

Implemented by


Default constructor.


documentableChild APIDocumentable
Returns the next documentable object in a chain of documentable objects. [...]
logger Logger
An instance of the 'aqueduct' logger.
nextController RequestController
Receives requests that this controller does not respond to. [...]
policy CORSPolicy
The CORS policy of this controller.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


applyCORSHeadersIfNecessary(Request req, Response resp) → void
generate(RequestController instantiator()) RequestController
Sets the nextController that will receive a request after this one. [...]
handleError(Request request, dynamic caughtValue, StackTrace trace) Future<bool>
Sends an HTTP response for a request that yields an exception or error. [...]
listen(FutureOr<RequestOrResponse> process(Request request)) RequestController
Sets the nextController that will receive a request after this one. [...]
pipe(RequestController next) RequestController
Sets the nextController that will receive a request after this one. [...]
processRequest(Request req) FutureOr<RequestOrResponse>
Overridden by subclasses to modify or respond to an incoming request. [...]
receive(Request req) Future
Delivers req to this instance to be processed. [...]
willSendResponse(Response response) → void
Executed prior to Response being sent. [...]
documentAPI(PackagePathResolver resolver) APIDocument
Returns an entire APIDocument describing an OpenAPI specification. [...]
documentOperations(PackagePathResolver resolver) List<APIOperation>
Returns all APIOperations this object knows about.
documentPaths(PackagePathResolver resolver) List<APIPath>
Returns all APIPath objects this instance knows about. [...]
documentRequestBodyForOperation(APIOperation operation) APIRequestBody
Returns all APIRequestBodys for operation.
documentResponsesForOperation(APIOperation operation) List<APIResponse>
Returns all APIResponses for operation.
documentSecuritySchemes(PackagePathResolver resolver) Map<String, APISecurityScheme>
Returns all APISecuritySchemes this instance knows about.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
Returns a string representation of this object.


operator ==(dynamic other) bool
The equality operator. [...]

Static Properties

includeErrorDetailsInServerErrorResponses bool
Returns a stacktrace and additional details about how the request's processing in the HTTP response. [...]
read / write
letUncaughtExceptionsEscape bool
Whether or not to allow uncaught exceptions escape request controllers. [...]
read / write