onData property

Future<bool> Function(HttpRequest request)? get onData

A custom callback that is called when a new request is received by the server that can be used to send or modify the response, for example adding custom headers. If this callback returns true, it means that the request has been handled by this callback. Otherwise, if this callback returns false, the server will continue to process the request using the default implementation.

Implementation

Future<bool> Function(HttpRequest request)? get onData => platform.onData;