BodyParser

play.api.mvc.BodyParser
See theBodyParser companion trait
object BodyParser

Helper object to construct BodyParser values.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
BodyParser.type

Members list

Value members

Concrete methods

def apply[T](f: RequestHeader => Accumulator[ByteString, Either[Result, T]]): BodyParser[T]
def apply[T](debugName: String)(f: RequestHeader => Accumulator[ByteString, Either[Result, T]]): BodyParser[T]
def parseBody[A](parser: BodyParser[A], request: Request[A], next: Request[A] => Future[Result])(implicit ec: ExecutionContext): Future[Result]

When body parsing was deferred, this method can be used to eventually parse the body for a given request. If this method was called already for a request (meaning the body was finally parsed already), it won't do anything anymore and just pass the request through.

When body parsing was deferred, this method can be used to eventually parse the body for a given request. If this method was called already for a request (meaning the body was finally parsed already), it won't do anything anymore and just pass the request through.

Value parameters

ec

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

next

called after the body was parsed

parser

the body parser to use to parse the requests' body

request

the request whose body was not parsed yet (because parsing was explicitly deferred)

Attributes

Returns

the result to be sent to the client