onResponse method

  1. @override
Future<FittorResponse> onResponse(
  1. FittorResponse response
)
override

Called after a successful response is received

Can modify the response or return a completely new response. The returned response will be passed to the next interceptor or returned to the caller.

response The received response Returns the response to be processed (can be modified or replaced)

Implementation

@override
Future<FittorResponse> onResponse(FittorResponse response) async {
  // We can't easily check the original request here, so we always process responses
  // You might want to store the request in the response's extra data for this to work
  return await interceptor.onResponse(response);
}