onRequest method

  1. @override
void onRequest(
  1. RequestContext context,
  2. RequestHandler handler
)
override

Called before the request is sent. Mutate handler.context or call handler.reject to abort.

Implementation

@override
void onRequest(RequestContext context, RequestHandler handler) {
  _log('→ ${context.method} ${context.uri}');
  if (context.headers.isNotEmpty) _log('  headers: ${context.headers}');
  if (context.body != null) _log('  body: ${context.body}');
  handler.next(context);
}