BodyParserUtils

play.api.mvc.BodyParserUtils
See theBodyParserUtils companion object

A set of reusable body parsers and utilities that do not require configuration.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

Don't parse the body content.

Don't parse the body content.

Attributes

def error[A](result: Future[Result]): BodyParser[A]

A body parser that always returns an error.

A body parser that always returns an error.

Attributes

def flatten[A](underlying: Future[BodyParser[A]])(implicit ec: ExecutionContext, mat: Materializer): BodyParser[A]

A body parser that flattens a future BodyParser.

A body parser that flattens a future BodyParser.

Attributes

def ignore[A](body: A): BodyParser[A]
def maxLength[A](maxLength: Long, parser: BodyParser[A])(implicit mat: Materializer): BodyParser[Either[MaxSizeExceeded, A]]

Wrap an existing BodyParser with a maxLength constraints.

Wrap an existing BodyParser with a maxLength constraints.

Value parameters

maxLength

The max length allowed

parser

The BodyParser to wrap

Attributes

def using[A](f: RequestHeader => BodyParser[A]): BodyParser[A]

Allows to choose the right BodyParser parser to use by examining the request headers.

Allows to choose the right BodyParser parser to use by examining the request headers.

Attributes

def when[A](predicate: RequestHeader => Boolean, parser: BodyParser[A], badResult: RequestHeader => Future[Result]): BodyParser[A]

Creates a conditional BodyParser.

Creates a conditional BodyParser.

Attributes