Response class

Constructors

Response(String body, {int status = 200, Map<String, String>? headers})

Properties

body String
Response body
getter/setter pair
contentType ContentType
Content type
getter/setter pair
cookies List<Cookie>
Get cookies
no setter
disablePayload bool
Disable payload
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
Get headers
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status int
HTTP status
getter/setter pair

Methods

addCookie(Cookie cookie) Response
Add cookie
addHeader(String key, String value) Response
Add header
html(String data, {int status = HttpStatus.ok}) → void
Set HTML response
json(Map<String, dynamic> data, {int status = HttpStatus.ok}) → void
Set json response
noContent() → void
Set empty response
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeCookie(Cookie cookie) Response
Remove cookie
removeHeader(String key) Response
Remove header
text(String data, {int status = HttpStatus.ok}) → void
Set text response
toString() String
A string representation of this object.
inherited

Operators

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