postJson method

Route postJson(
  1. String path,
  2. RouteHandler handler, {
  3. Map<String, String>? pathRegEx,
  4. int statusCode = 200,
  5. String? mimeType,
  6. String? charset = kDefaultCharset,
  7. ResponseProcessor? responseProcessor = jsonResponseProcessor,
  8. List<RouteInterceptor>? after,
  9. List<RouteInterceptor>? before,
  10. List<ExceptionHandler>? onException,
})

Adds a route with POST method to be served

Implementation

Route postJson(String path, RouteHandler handler,
    {Map<String, String>? pathRegEx,
    int statusCode = 200,
    String? mimeType,
    String? charset = kDefaultCharset,
    ResponseProcessor? responseProcessor = jsonResponseProcessor,
    List<RouteInterceptor>? after,
    List<RouteInterceptor>? before,
    List<ExceptionHandler>? onException}) {
  final route = Route.postJson(path, handler,
      pathRegEx: pathRegEx,
      statusCode: statusCode,
      mimeType: mimeType,
      charset: charset,
      responseProcessor: responseProcessor,
      before: before,
      after: after,
      onException: onException);
  return addRoute(route);
}