ServerPipeline class

A pipeline.

A pipeline contains an ordered sequence of rules, grouped by their method.

When a HTTP request is processed by a Server, it is processed by the pipelines of the server (in order). Although, often there is often only one pipeline in the server. Multiple pipelines are usually used for applications with complex processing requirements.

When a HTTP request is processed by a ServerPipeline, the rules for the request method (e.g. GET or POST) are examined in order. If a rule's ServerRule matches the request, its handler is invoked with the request. If the handler returns a Response, processing stops and that becomes the HTTP response. If the handler returns null, processing continues by attempting to match the request with subsequent rules in the pipeline (if any) and then subsequent pipelines in the server. That is, handlers are invoked if their pattern matches the request, and processing stops with the first handler that doesn't return null.

Constructors

ServerPipeline([String name = defaultName])
Pipeline constructor.

Properties

exceptionHandler ExceptionHandler?
Pipeline level exception/error handler.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
name String
Name of the pipeline.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String pattern, RequestHandler handler) → void
Register a DELETE request handler.
get(String pattern, RequestHandler handler) → void
Register a GET request handler.
Register a HEAD request handler.
methods() Iterable<String>
Returns the methods in the pipeline
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch(String pattern, RequestHandler handler) → void
Register a PATCH request handler.
post(String pattern, RequestHandler handler) → void
Register a POST request handler.
put(String pattern, RequestHandler handler) → void
Register a PUT request handler.
register(String method, String pattern, RequestHandler handler) → void
Register a request handler for any HTTP method with a pattern string.
registerPattern(String method, Pattern pattern, RequestHandler handler) → void
Register a request handler for any HTTP method with a Pattern.
rules(String method) List<ServerRule>
Returns the rules in the pipeline for a given method.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

defaultName → const String
Default pipeline name.