Request class

A single HTTP request.

Instances of this class travel through a Controller chain to be responded to, sometimes acquiring new values as they go through controllers. Each instance of this class has a standard library HttpRequest. You should not respond directly to the HttpRequest, as Controllers take that responsibility.

Implemented types

Constructors

Request(HttpRequest raw)
Creates an instance of Request, no need to do so manually.

Properties

acceptableContentTypes List<ContentType>?
The acceptable content types for a Response returned for this instance.
no setter
attachments Map
Container for any data a Controller wants to attach to this request for the purpose of being used by a later Controller.
getter/setter pair
authorization Authorization?
Authorization information associated with this request.
getter/setter pair
body RequestBody
The request body object.
final
connectionInfo HttpConnectionInfo?
Information about the client connection.
no setter
hashCode int
The hash code for this object.
no setterinherited
isCORSRequest bool
Whether or not this request is a CORS request.
no setter
isPreflightRequest bool
Whether or not this is a CORS preflight request.
no setter
method String
HTTP method of this request.
no setter
path RequestPath
The path of the request URI.
final
raw HttpRequest
The underlying HttpRequest of this instance.
final
receivedDate DateTime
The timestamp for when this request was received.
getter/setter pair
respondDate DateTime?
The timestamp for when this request was responded to.
getter/setter pair
response HttpResponse
The response object of this Request.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

acceptsContentType(ContentType contentType) bool
Whether a Response may contain a body of type contentType.
addResponseModifier(void modifier(Response response)) → void
Allows a Controller to modify the response eventually created for this request, without creating that response itself.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
respond(Response aquedartResponse) Future
Sends a Response to this Request's client.
toDebugString({bool includeElapsedTime = true, bool includeRequestIP = false, bool includeMethod = true, bool includeResource = true, bool includeStatusCode = true, bool includeContentSize = false, bool includeHeaders = false}) String
A string that represents more details about the request, typically used for logging.
toString() String
A string representation of this object.
override

Operators

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