onRequest method

  1. @override
Future<void> onRequest(
  1. Uri url,
  2. HttpMethod method,
  3. Map<String, String> headers,
  4. dynamic body,
)
override

Called before a request is sent

Implementation

@override
Future<void> onRequest(
  Uri url,
  HttpMethod method,
  Map<String, String> headers,
  dynamic body,
) async {
  _logger.i('🚀 ${method.name.toUpperCase()} Request to: $url');

  if (headers.isNotEmpty) {
    _logger.d('📋 Headers: $headers');
  }

  if (body != null) {
    _logger.d('📦 Body: $body');
  }
}