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()

Properties

exceptionHandler ExceptionHandler
Pipeline level exception/error handler. [...]
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

Methods

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

Operators

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