HttpResponse<T> class
final
Class that represents the response of a HTTP's request.
Constructors
-
HttpResponse({required RequestOptions requestOptions, T? data, int? statusCode, String? statusMessage, bool isRedirect = false, List<
RedirectRecord> redirects = const [], Map<String, dynamic> ? extra, Headers? headers, String? segment, String? step}) -
HttpResponse.fromDioResponse(Response<
T> response, {String? segment, String? step}) -
Factory that creates a HttpResponse from a
dio.Response
.factory
Properties
- data ↔ T?
-
The response payload in specific type.
getter/setter pairinherited
-
extra
↔ Map<
String, dynamic> -
An extra map that you can save your custom information in.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- headers ↔ Headers
-
Headers for the response.
getter/setter pairinherited
- isRedirect ↔ bool
-
Whether the response has been redirected.
getter/setter pairinherited
- realUri → Uri
-
Return the final real request URI (may be redirected).
no setterinherited
-
redirects
↔ List<
RedirectRecord> -
All redirections happened before the response respond.
getter/setter pairinherited
- requestOptions ↔ RequestOptions
-
The
RequestOptions
used for the corresponding request.getter/setter pairinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- segment → String?
-
Optional description of the module/service that the request is supposed to hit.
final
- statusCode ↔ int?
-
The HTTP status code for the response.
getter/setter pairinherited
- statusMessage ↔ String?
-
Returns the reason phrase associated with the status code.
getter/setter pairinherited
- step → String?
-
Optional description of what the request is supposed to do.
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