Packages

  • package root
    Definition Classes
    root
  • package play

    Play framework.

    Play framework.

    Play

    http://www.playframework.com

    Definition Classes
    root
  • package api

    Contains the public API for Scala developers.

    Contains the public API for Scala developers.

    Access the current Play application
    import play.api.Play.current
    Read configuration
    val poolSize = configuration.getInt("engine.pool.size")
    Use the logger
    Logger.info("Hello!")
    Define a Plugin
    class MyPlugin(app: Application) extends Plugin
    Create adhoc applications (for testing)
    val application = Application(new File("."), this.getClass.getClassloader, None, Play.Mode.DEV)
    Definition Classes
    play
  • package mvc

    Contains the Controller/Action/Result API to handle HTTP requests.

    Contains the Controller/Action/Result API to handle HTTP requests.

    For example, a typical controller:

    class HomeController @Inject() (val controllerComponents: ControllerComponents) extends BaseController {
    
      def index = Action {
        Ok("It works!")
      }
    
    }
    Definition Classes
    api
  • object BodyParsers extends BodyParsers

    Default BodyParsers.

    Default BodyParsers.

    Definition Classes
    mvc
  • Default
  • utils

class Default extends BodyParser[AnyContent]

The default body parser provided by Play

Source
BodyParsers.scala
Linear Supertypes
BodyParser[AnyContent], (RequestHeader) ⇒ Accumulator[ByteString, Either[Result, AnyContent]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Default
  2. BodyParser
  3. Function1
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Default(tfc: TemporaryFileCreator = SingletonTemporaryFileCreator, eh: HttpErrorHandler = new DefaultHttpErrorHandler(), config: ParserConfiguration = ParserConfiguration())(implicit mat: Materializer)

    An alternate constructor primarily designed for unit testing.

    An alternate constructor primarily designed for unit testing. Default values are set to empty or singleton implementations where appropriate.

  2. new Default(parse: PlayBodyParsers)
    Annotations
    @Inject()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[A](g: (Accumulator[ByteString, Either[Result, AnyContent]]) ⇒ A): (RequestHeader) ⇒ A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. def apply(rh: RequestHeader): Accumulator[ByteString, Either[Result, AnyContent]]
    Definition Classes
    Default → Function1
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  8. def compose[A](g: (A) ⇒ RequestHeader): (A) ⇒ Accumulator[ByteString, Either[Result, AnyContent]]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def map[B](f: (AnyContent) ⇒ B)(implicit ec: ExecutionContext): BodyParser[B]

    Uses the provided function to transform the BodyParser's computed result when the request body has been parsed.

    Uses the provided function to transform the BodyParser's computed result when the request body has been parsed.

    f

    a function for transforming the computed result

    ec

    The context to execute the supplied function with. The context is prepared on the calling thread.

    returns

    the transformed body parser

    Definition Classes
    BodyParser
    See also

    play.api.libs.streams.Accumulator.map

  16. def mapM[B](f: (AnyContent) ⇒ Future[B])(implicit ec: ExecutionContext): BodyParser[B]

    Like map but allows the map function to execute asynchronously.

    Like map but allows the map function to execute asynchronously.

    f

    the async function to map the result of the body parser

    ec

    The context to execute the supplied function with. The context prepared on the calling thread.

    returns

    the transformed body parser

    Definition Classes
    BodyParser
    See also

    map

    play.api.libs.streams.Accumulator.mapFuture[B]

  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  22. def validate[B](f: (AnyContent) ⇒ Either[Result, B])(implicit ec: ExecutionContext): BodyParser[B]

    Uses the provided function to validate the BodyParser's computed result when the request body has been parsed.

    Uses the provided function to validate the BodyParser's computed result when the request body has been parsed.

    The provided function can produce either a direct result, which will short circuit any further Action, or a value of type B.

    Example:

    def validateJson[A : Reads] = parse.json.validate(
      _.validate[A].asEither.left.map(e => BadRequest(JsError.toJson(e)))
    )
    f

    the function to validate the computed result of this body parser

    ec

    The context to execute the supplied function with. The context is prepared on the calling thread.

    returns

    the transformed body parser

    Definition Classes
    BodyParser
  23. def validateM[B](f: (AnyContent) ⇒ Future[Either[Result, B]])(implicit ec: ExecutionContext): BodyParser[B]

    Like validate but allows the validate function to execute asynchronously.

    Like validate but allows the validate function to execute asynchronously.

    f

    the async function to validate the computed result of this body parser

    ec

    The context to execute the supplied function with. The context is prepared on the calling thread.

    returns

    the transformed body parser

    Definition Classes
    BodyParser
    See also

    validate

  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from BodyParser[AnyContent]

Inherited from (RequestHeader) ⇒ Accumulator[ByteString, Either[Result, AnyContent]]

Inherited from AnyRef

Inherited from Any

Ungrouped