TResponseBody<T> class

A wrapper around a HTTP response for typed responses.

Constructors

TResponseBody({required T data, required int statusCode, required String? statusMessage, required bool isRedirect, required List<RedirectRecord>? redirects, required Headers headers})
Default constructor.
TResponseBody.fromResponse(Response response, T data)
Creates a TResponseBody from a response and the already decoded data.
TResponseBody.fromResponseBody(ResponseBody responseBody, T data)
Creates a TResponseBody from a responseBody and the already decoded data.

Properties

contentLength → int
Content length of the response or -1 if not specified
no setter
data → T
The decoded response body.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Headers
The response headers.
final
isRedirect → bool
Whether this response is a redirect.
final
redirects → List<RedirectRecord>?
Stores redirections during the request.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statusCode → int
HTTP status code.
final
statusMessage → String?
Returns the reason phrase corresponds to the status code.
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