Route.getJson constructor

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

Constructs a Route for JSON requests with GET method

Implementation

factory Route.getJson(String path, RouteHandler handler,
        {Map<String, String>? pathRegEx,
        int? statusCode,
        String? mimeType,
        String? charset = kDefaultCharset,
        ResponseProcessor? responseProcessor = jsonResponseProcessor,
        List<RouteInterceptor>? after,
        List<RouteInterceptor>? before,
        List<ExceptionHandler>? onException}) =>
    Route.fromInfo(
        HttpMethod(
            methods: ['GET'],
            path: path,
            pathRegEx: pathRegEx,
            statusCode: statusCode,
            mimeType: mimeType,
            charset: charset,
            responseProcessor: responseProcessor),
        handler,
        before: before,
        after: after,
        onException: onException);