TestResponse class Null safety

An HTTP response from a test application.

You receive objects of this type when using an Agent to execute test requests. The properties of this object are used in test expectations to ensure the endpoint worked as intended.

Prefer to use methods like expectResponse, hasResponse and hasStatus when validating response properties.

Properties

body TestResponseBody
The HTTP body of the response. [...]
final
contentLength int
The Content-Length of the response if provided.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
headers HttpHeaders
HTTP response headers.
read-only
innerResponse HttpClientResponse
HTTP response.
read-only
isRedirect bool
Whether or not the response is a redirect.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
statusCode int
The status code of the response.
read-only

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
override

Operators

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