Protected hook method called on every inbound SWML request, before the document
is returned to SignalWire. Override this in a subclass to inspect the request
and return a customized SwmlBuilder for this request.
Returning null delegates to the next handler in the chain (any callback
registered via setOnRequestCallback(), or the
static builder). The default implementation returns null.
The TypeScript signature differs from the Python SDK’s on_request(request_data, callback_path) in two ways:
request_data.SwmlBuilder instance (or null) rather
than a dictionary of modifications to merge. This means a TS override replaces
the document entirely rather than patching it.URL query parameters from the request.
Parsed POST body. Empty object for GET requests. Typically contains call
metadata from SignalWire (e.g., call.to, call.from, call.headers).
HTTP request headers.
The routing callback path that matched this request, if any. Set when the
request arrived through a path registered via
registerRoutingCallback(); undefined for
requests to the main route.
SwmlBuilder | null — a SwmlBuilder whose document is
served for this request, or null to delegate to the next handler.