Response<ValueType> class

HTTP response. A route handler must respond to HTTP requests by producing a Response object.

ValueType specializes the value contained by it.

writeResponse can be used to write response to underlying abstracted response object.

Implementers

Constructors

Response(ValueType value, { int statusCode: 200, Map<String, dynamic> headers, String mimeType String charset: kDefaultCharset })

Properties

cookies → List<Cookie>
Cookies
final
headers JaguarHttpHeaders
Headers
final
statusCode ↔ int
Status code of the response
read / write
value ↔ ValueType
Body of the response
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

deleteCookie(String name, { String path: '/' }) → void
deleteCookie deletes a cookie with given name. Use path to specify the path from which the cookie has to be removed.
writeAllButBody(HttpResponse resp) → void
writeResponse(HttpResponse resp) → FutureOr<void>
Writes body of the HTTP response from value property [...]
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

Static Methods

html(String html, { int statusCode: HttpStatus.ok, Map<String, dynamic> headers, String mimeType: MimeTypes.html String charset: kDefaultCharset }) Response<String>
json<ST>(ST value, { dynamic serializeWith(ST value), int statusCode: HttpStatus.ok, Map<String, dynamic> headers, String mimeType: MimeTypes.json String charset: kDefaultCharset }) Response<String>