Package play.mvc

Class BodyParser.TolerantJson

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

    public static class BodyParser.TolerantJson
    extends BodyParser.BufferingBodyParser<com.fasterxml.jackson.databind.JsonNode>
    Parse the body as Json without checking the Content-Type.
    • Constructor Detail

      • TolerantJson

        public TolerantJson​(long maxLength,
                            HttpErrorHandler errorHandler)
      • TolerantJson

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

      • parse

        protected com.fasterxml.jackson.databind.JsonNode parse​(Http.RequestHeader request,
                                                                ByteString bytes)
                                                         throws Exception
        Description copied from class: BodyParser.BufferingBodyParser
        Parse the body.
        Specified by:
        parse in class BodyParser.BufferingBodyParser<com.fasterxml.jackson.databind.JsonNode>
        Parameters:
        request - The request associated with the body.
        bytes - The bytes of the body.
        Returns:
        The body.
        Throws:
        Exception - If the body failed to parse. It is assumed that any exceptions thrown by this method are the fault of the client, so a 400 bad request error will be returned if this method throws an exception.