ResponseFuture extension Extensions Error handling

Extensions on Future<http.Response> to allow usage of some methods from RestResponse as a shortcut.

on

Properties

jsonBody Future<Object?>
Returns the json object decoded from response body by calling RestResponse.jsonBody after converting the response to RestResponse.
no setter
jsonBodyAsync Future<Object?>
Returns the json object decoded asynchronously from response body by calling RestResponse.jsonBody after converting the response to RestResponse.
no setter

Methods

data<T extends Object>() Future<T?>
Returns the deserialized response body by calling RestResponse.deserializeBody after converting the response to RestResponse.
dataAsync<T extends Object>() Future<T?>
Returns the asynchronously deserialized response body by calling RestResponse.deserializeBodyAsync after converting the response to RestResponse.