ScriptedResponse class

A scripted reply: status, headers, and body bytes.

Annotations
  • @immutable

Constructors

ScriptedResponse({int status = 200, Map<String, String> headers = const {'content-type' : 'application/json; charset=utf-8'}, Object? json, String? body, List<int>? bytes})
const

Properties

body → String?
Raw text body (mutually exclusive with json/bytes).
final
bytes → List<int>?
Raw byte body, for binary responses (mutually exclusive with the other body fields).
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, String>
Response headers (defaults to an application/json content type).
final
json → Object?
JSON body (mutually exclusive with body/bytes).
final
payload → List<int>
The response payload as bytes: explicit bytes, then text, then JSON.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → int
HTTP status code to answer with (default 200).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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