onResponse method

Future<Response> onResponse(
  1. Response response,
  2. Request request,
  3. Future<Response> retry(
    1. Request
    )
)

Called for each Response that comes back from the network.

The retry callback re-executes the downstream link chain with the given request — use it to replay a request after refreshing a token or updating headers.

Implementation

Future<Response> onResponse(
  Response response,
  Request request,
  Future<Response> Function(Request) retry,
) async => response;