HttpResponse extension
Extension methods for parsing HTTP responses from the Dio
package.
This extension provides methods for converting response data into various
data types, including custom JSON models, lists, primitives, and DateTime
.
- on
-
- Response
Methods
-
body<
T extends JsonModel> () → T -
Available on Response, provided by the HttpResponse extension
Converts the response data to a JsonModel instance. -
bodyAsBoolean(
) → bool -
Available on Response, provided by the HttpResponse extension
Converts the response data to a boolean. -
bodyAsDateTime(
) → DateTime -
Available on Response, provided by the HttpResponse extension
Converts the response data to a DateTime. -
bodyAsDouble(
) → double -
Available on Response, provided by the HttpResponse extension
Converts the response data to a double. -
bodyAsInteger(
) → int -
Available on Response, provided by the HttpResponse extension
Converts the response data to an integer. -
bodyAsList<
T extends JsonModel> () → List< T> -
Available on Response, provided by the HttpResponse extension
Converts the response data to a list of JsonModel instances. -
bodyAsNumber(
) → num -
Available on Response, provided by the HttpResponse extension
Converts the response data to a number. -
bodyAsString(
) → String -
Available on Response, provided by the HttpResponse extension
Converts the response data to a string.