onRequest method

  1. @override
FutureOr onRequest(
  1. RequestOptions options,
  2. RequestInterceptorHandler handler
)

The callback will be executed before the request is initiated.

Implementation

@override
FutureOr<dynamic> onRequest(
  RequestOptions options,
  RequestInterceptorHandler handler,
) {
  loggy.debug('URI: ${options.uri}');

  loggy.debug('HEADERS:\n${options.headers}');

  loggy.debug('REQUEST:\n${options.data}');

  handler.next(options);
}