Response<T> class

The Response class contains the payload (could be transformed) that respond from the request, and other information of the response.

The object is not sealed or immutable, which means it can be manipulated in anytime, typically by Interceptor and Transformer.

Available extensions

Constructors

Response({T? data, required RequestOptions requestOptions, int? statusCode, String? statusMessage, bool isRedirect = false, List<RedirectRecord> redirects = const [], Map<String, dynamic>? extra, Headers? headers})

Properties

data ↔ T?
The response payload in specific type.
getter/setter pair
extra Map<String, dynamic>
An extra map that you can save your custom information in.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Headers
Headers for the response.
getter/setter pair
isRedirect bool
Whether the response has been redirected.
getter/setter pair
realUri Uri
Return the final real request URI (may be redirected).
no setter
redirects List<RedirectRecord>
All redirections happened before the response respond.
getter/setter pair
requestOptions RequestOptions
The RequestOptions used for the corresponding request.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?
The HTTP status code for the response.
getter/setter pair
statusMessage String?
Returns the reason phrase associated with the status code.
getter/setter pair

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