Object

play.api.mvc.BodyParsers

parse

Related Doc: package BodyParsers

Permalink

object parse

Default body parsers.

Source
ContentTypes.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. parse
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def DefaultMaxDiskLength: Long

    Permalink

    Default max length allowed for disk based body.

    Default max length allowed for disk based body.

    You can configure it in application.conf:

    play.http.parser.maxDiskBuffer = 512k
  5. def DefaultMaxTextLength: Int

    Permalink

    Default max length allowed for text based body.

    Default max length allowed for text based body.

    You can configure it in application.conf:

    play.http.parser.maxMemoryBuffer = 512k
  6. val UNLIMITED: Long

    Permalink

    Unlimited size.

  7. def anyContent(maxLength: Option[Long]): BodyParser[AnyContent]

    Permalink

    Guess the body content by checking the Content-Type header.

  8. def anyContent: BodyParser[AnyContent]

    Permalink

    Guess the body content by checking the Content-Type header.

  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def default(maxLength: Option[Long]): BodyParser[AnyContent]

    Permalink

    If the request is a PATCH, POST, or PUT, parse the body content by checking the Content-Type header.

  12. def default: BodyParser[AnyContent]

    Permalink

    If the request is a PATCH, POST, or PUT, parse the body content by checking the Content-Type header.

  13. def empty: BodyParser[Unit]

    Permalink

    Don't parse the body content.

  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  16. def error[A](result: Future[Result]): BodyParser[A]

    Permalink

    A body parser that always returns an error.

  17. def file(to: File): BodyParser[File]

    Permalink

    Store the body content into a file.

    Store the body content into a file.

    to

    The file used to store the content.

  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def form[A](form: Form[A], maxLength: Option[Long] = None, onErrors: (Form[A]) ⇒ Result = ...): BodyParser[A]

    Permalink

    Parse the body and binds it to a given form model.

    Parse the body and binds it to a given form model.

    case class User(name: String)
    
    val userForm: Form[User] = Form(mapping("name" -> nonEmptyText)(User.apply)(User.unapply))
    
    Action(parse.form(userForm)) { request =>
      Ok(s"Hello, ${request.body.name}!")
    }
    form

    Form model

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response. If None, the default play.http.parser.maxMemoryBuffer configuration value is used.

    onErrors

    The result to reply in case of errors during the form binding process

  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. def ignore[A](body: A): BodyParser[A]

    Permalink
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def json[A](implicit reader: Reads[A]): BodyParser[A]

    Permalink

    Parse the body as Json if the Content-Type is text/json or application/json, validating the result with the Json reader.

    Parse the body as Json if the Content-Type is text/json or application/json, validating the result with the Json reader.

    A

    the type to read and validate from the body.

    reader

    a Json reader for type A.

  25. def json: BodyParser[JsValue]

    Permalink

    Parse the body as Json if the Content-Type is text/json or application/json.

  26. def json(maxLength: Int): BodyParser[JsValue]

    Permalink

    Parse the body as Json if the Content-Type is text/json or application/json.

    Parse the body as Json if the Content-Type is text/json or application/json.

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response.

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

    Permalink

    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

  28. def multipartFormData[A](filePartHandler: FilePartHandler[A], maxLength: Long = DefaultMaxDiskLength): BodyParser[MultipartFormData[A]]

    Permalink

    Parse the content as multipart/form-data

    Parse the content as multipart/form-data

    filePartHandler

    Handles file parts.

  29. def multipartFormData: BodyParser[MultipartFormData[TemporaryFile]]

    Permalink

    Parse the content as multipart/form-data

  30. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. def raw: BodyParser[RawBuffer]

    Permalink

    Store the body content in a RawBuffer.

  34. def raw(memoryThreshold: Int = DefaultMaxTextLength, maxLength: Long = DefaultMaxDiskLength): BodyParser[RawBuffer]

    Permalink

    Store the body content in a RawBuffer.

    Store the body content in a RawBuffer.

    memoryThreshold

    If the content size is bigger than this limit, the content is stored as file.

  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def temporaryFile: BodyParser[TemporaryFile]

    Permalink

    Store the body content into a temporary file.

  37. def text: BodyParser[String]

    Permalink

    Parse the body as text if the Content-Type is text/plain.

  38. def text(maxLength: Int): BodyParser[String]

    Permalink

    Parse the body as text if the Content-Type is text/plain.

    Parse the body as text if the Content-Type is text/plain.

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response.

  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. def tolerantFormUrlEncoded: BodyParser[Map[String, Seq[String]]]

    Permalink

    Parse the body as form url encoded without checking the Content-Type.

  41. def tolerantFormUrlEncoded(maxLength: Int): BodyParser[Map[String, Seq[String]]]

    Permalink

    Parse the body as Form url encoded without checking the Content-Type.

    Parse the body as Form url encoded without checking the Content-Type.

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response.

  42. def tolerantJson: BodyParser[JsValue]

    Permalink

    Parse the body as Json without checking the Content-Type.

  43. def tolerantJson(maxLength: Int): BodyParser[JsValue]

    Permalink

    Parse the body as Json without checking the Content-Type.

    Parse the body as Json without checking the Content-Type.

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response.

  44. def tolerantText: BodyParser[String]

    Permalink

    Parse the body as text without checking the Content-Type.

  45. def tolerantText(maxLength: Long): BodyParser[String]

    Permalink

    Parse the body as text without checking the Content-Type.

    Parse the body as text without checking the Content-Type.

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response.

  46. def tolerantXml: BodyParser[NodeSeq]

    Permalink

    Parse the body as Xml without checking the Content-Type.

  47. def tolerantXml(maxLength: Int): BodyParser[NodeSeq]

    Permalink

    Parse the body as Xml without checking the Content-Type.

    Parse the body as Xml without checking the Content-Type.

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response.

  48. def urlFormEncoded: BodyParser[Map[String, Seq[String]]]

    Permalink

    Parse the body as form url encoded if the Content-Type is application/x-www-form-urlencoded.

  49. def urlFormEncoded(maxLength: Int): BodyParser[Map[String, Seq[String]]]

    Permalink

    Parse the body as form url encoded if the Content-Type is application/x-www-form-urlencoded.

    Parse the body as form url encoded if the Content-Type is application/x-www-form-urlencoded.

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response.

  50. def using[A](f: (RequestHeader) ⇒ BodyParser[A]): BodyParser[A]

    Permalink

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

  51. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. def when[A](predicate: (RequestHeader) ⇒ Boolean, parser: BodyParser[A], badResult: (RequestHeader) ⇒ Future[Result]): BodyParser[A]

    Permalink

    Create a conditional BodyParser.

  55. def xml: BodyParser[NodeSeq]

    Permalink

    Parse the body as Xml if the Content-Type is application/xml, text/xml or application/XXX+xml.

  56. def xml(maxLength: Int): BodyParser[NodeSeq]

    Permalink

    Parse the body as Xml if the Content-Type is application/xml, text/xml or application/XXX+xml.

    Parse the body as Xml if the Content-Type is application/xml, text/xml or application/XXX+xml.

    maxLength

    Max length allowed or returns EntityTooLarge HTTP response.

Inherited from AnyRef

Inherited from Any

Ungrouped