onRequest method
Called when the request is about to be sent.
Implementation
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
final id = _generateId();
options.extra['debug_id'] = id;
final entry = DebugLogEntry(
id: id,
timestamp: DateTime.now(),
method: stringToHttpMethod(options.method.toLowerCase()),
url: options.uri.toString(),
baseUrl: options.baseUrl,
requestData: _toMap(options.data),
queryParameters: options.queryParameters,
);
_pendingLogs[id] = entry;
_controller.addLog(entry);
handler.next(options);
}