FakeResponse class final
The answer of a handler.
Constructors
-
FakeResponse(int status, [Object? body, Map<
String, String> headers = const {}]) -
A response with
status, a JSONbody(none when null) and extraheaders.const -
FakeResponse.bytes(List<
int> bytes, {required String contentType, int status = 200, Map<String, String> headers = const {}}) -
A response with the binary
bytesofcontentType(animage/*download such asgetBrandingLogo, a file ofdownloadFile); the contract check sees no JSON body.statusis200unless a range gives206;headersaddsETag,Repr-Digestand the like.const - FakeResponse.noContent()
-
204 No Content.const
Properties
- body → Object?
-
The JSON body, or null.
final
-
bytes
→ List<
int> ? -
The binary body of FakeResponse.bytes, or null.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
Extra headers.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → int
-
The HTTP status.
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