trait BodyParserUtils extends AnyRef

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

Source
BodyParsers.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BodyParserUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def empty: BodyParser[Unit]

    Don't parse the body content.

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

    A body parser that always returns an error.

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

    A body parser that flattens a future BodyParser.

  4. def ignore[A](body: A): BodyParser[A]
  5. 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.

    maxLength

    The max length allowed

    parser

    The BodyParser to wrap

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

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

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

    Creates a conditional BodyParser.