HttpResponse class

Represents a HTTP response.

Inheritance

Constructors

HttpResponse([String body = "", int status = 200])

Properties

body String
The response body.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, List<String>>
The headers to respond with.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status int
The HTTP status code to respond with. Defaults to 200 (ok).
getter/setter pair

Methods

json(Map<String, dynamic> contents) → void
Sets the response body as a json string and adds a json content type if the content type isn't set.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
toWire() → HttpResponse
Converts to a gRPC response.
withError(Object e) → void
Creates a http response with an error for the body and 500 (internal server error) as the status.

Operators

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