onHttpSuccess method
Method used to handle a successful Http call. Conveniently placed in this class to facilitate overrides.
Implementation
HttpActionResult onHttpSuccess(
HttpResponse response, NodeSpec action, ActionContext context) {
final data = (response.headers[HttpHeaders.contentTypeHeader] ?? "")
.contains("application/json")
? json.decodeWithReviver(response.body)
: response.body;
return HttpActionResult(true, returnData: data);
}