routeX abstract method

Router routeX(
  1. Route route,
  2. XRouterFunction handler
)

Registers a route whose handler accepts both a ServerHttpRequest and a ServerHttpResponse.

router.routeX(POST('/upload'), (req, res) async {
  await res.getBody().writeString('Uploaded!');
});

Implementation

Router routeX(Route route, XRouterFunction handler);