Request class Null safety

A single HTTP request.

Instances of this class travel through a Controller chain to be responded to, sometimes acquiring 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. [...]
read-only
attachments Map
Container for any data a Controller wants to attach to this request for the purpose of being used by a later Controller. [...]
read / write
authorization Authorization?
Authorization information associated with this request. [...]
read / write
body RequestBody
The request body object. [...]
final
connectionInfo HttpConnectionInfo?
Information about the client connection. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isCORSRequest bool
Whether or not this request is a CORS request. [...]
read-only
isPreflightRequest bool
Whether or not this is a CORS preflight request. [...]
read-only
method String
HTTP method of this request. [...]
read-only
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.
read / write
respondDate DateTime?
The timestamp for when this request was responded to. [...]
read / write
response HttpResponse
The response object of this Request. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

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 non-existent method or property is accessed. [...]
inherited
respond(Response conduitResponse) 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