Context class

Default Dia Context This object extended base HttpRequest and HttpResponse object for easy access to they fields

request - base HttpRequest response - base HttpResponse headers - base response HttpHeaders statusCode - response status code contentType - response ContentType field of headers

Constructors

Context(HttpRequest _request)
Create base Context object takes HttpRequest

Properties

body ↔ dynamic
getter/setter pair
canHijack bool
Whether this request can be hijacked.
no setter
contentType ContentType?
Response Content-type field of headers
getter/setter pair
error HttpError?
Error if ctxThrow
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers HttpHeaders
base response HttpHeaders
no setter
request HttpRequest
base HttpRequest
no setter
response HttpResponse
base HttpResponse
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
Response status code
getter/setter pair

Methods

hijack(void callback(StreamChannel<List<int>>)) → Never
Takes control of the underlying request socket.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(String key, String value) → void
Set Response HttpHeaders field key - key of header value - value for key of header
throwError(int status, {String? message, StackTrace? stackTrace, Exception? exception}) → void
Throw HttpError with status code, message and stackTrace and error
toString() String
A string representation of this object.
inherited

Operators

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