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


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


acceptableContentTypes List<ContentType>
The acceptable content types for a Response returned for this instance. [...]
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. [...]
connectionInfo HttpConnectionInfo?
Information about the client connection. [...]
hashCode int
The hash code for this object. [...]
read-only, inherited
isCORSRequest bool
Whether or not this request is a CORS request. [...]
isPreflightRequest bool
Whether or not this is a CORS preflight request. [...]
method String
HTTP method of this request. [...]
path RequestPath
The path of the request URI. [...]
raw HttpRequest
The underlying HttpRequest of this instance. [...]
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. [...]
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


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. [...]
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. [...]


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