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?>

Available on Future<Response>, provided by the ResponseFuture extension

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

Available on Future<Response>, provided by the ResponseFuture extension

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?>

Available on Future<Response>, provided by the ResponseFuture extension

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

Available on Future<Response>, provided by the ResponseFuture extension

Returns the asynchronously deserialized response body by calling RestResponse.deserializeBodyAsync after converting the response to RestResponse.