onResponse method

  1. @override
Future onResponse (Response response)

The callback will be executed on success.

If you want to reject the request with a error message, you can return a DioError object or return dio.reject . If you want to continue the request, return the Response object.

Implementation

@override
Future onResponse(Response response) {
  print(
      '<-- ${response.statusCode} ${(response.request != null ? (response.request.baseUrl + response.request.path) : 'URL')}');

  print('<-- END Response');
  return super.onResponse(response);
}