TestResponse class
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.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- headers → HttpHeaders
-
HTTP response headers.
no setter
- innerResponse → HttpClientResponse
-
HTTP response.
no setter
- isRedirect → bool
-
Whether or not the response is a redirect.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusCode → int
-
The status code of the response.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited