Package play.mvc

Class BodyParser.Json

  • All Implemented Interfaces:
    BodyParser<com.fasterxml.jackson.databind.JsonNode>
    Enclosing interface:
    BodyParser<A>

    public static class BodyParser.Json
    extends BodyParser.TolerantJson
    Parse the body as Json if the Content-Type is text/json or application/json.
    • Constructor Detail

      • Json

        @Inject
        public Json​(play.api.http.HttpConfiguration httpConfiguration,
                    HttpErrorHandler errorHandler)
    • Method Detail

      • apply

        public Accumulator<ByteString,​F.Either<Result,​com.fasterxml.jackson.databind.JsonNode>> apply​(Http.RequestHeader request)
        Description copied from interface: BodyParser
        Return an accumulator to parse the body of the given HTTP request.

        The accumulator should either produce a result if an error was encountered, or the parsed body.

        Specified by:
        apply in interface BodyParser<com.fasterxml.jackson.databind.JsonNode>
        Overrides:
        apply in class BodyParser.MaxLengthBodyParser<com.fasterxml.jackson.databind.JsonNode>
        Parameters:
        request - The request to create the body parser for.
        Returns:
        The accumulator to parse the body.