onResponse method

  1. @override
void onResponse(
  1. ResponseContext context,
  2. ResponseHandler handler
)
override

Called after a response is received (any status code). You may call handler.reject to convert a response into an error.

Implementation

@override
void onResponse(ResponseContext context, ResponseHandler handler) {
  _log('← ${context.statusCode} ${context.request.uri}');
  _log('  body: ${context.body.length > 500 ? '${context.body.substring(0, 500)}…' : context.body}');
  handler.next(context);
}