Class

play.api.mvc

DefaultPlayBodyParsers

Related Doc: package mvc

Permalink

class DefaultPlayBodyParsers extends PlayBodyParsers

Source
BodyParsers.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DefaultPlayBodyParsers
  2. PlayBodyParsers
  3. BodyParserUtils
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DefaultPlayBodyParsers(config: ParserConfiguration, errorHandler: HttpErrorHandler, materializer: Materializer, temporaryFileCreator: TemporaryFileCreator)

    Permalink
    Annotations
    @Inject()

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
    Definition Classes
    PlayBodyParsers
  5. def DefaultMaxTextLength: Long

    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
    Definition Classes
    PlayBodyParsers
  6. val UNLIMITED: Long

    Permalink

    Unlimited size.

    Unlimited size.

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

    Permalink

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

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

    Definition Classes
    PlayBodyParsers
  8. def anyContent: BodyParser[AnyContent]

    Permalink

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

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

    Definition Classes
    PlayBodyParsers
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def byteString: BodyParser[ByteString]

    Permalink

    Buffer the body as a simple akka.util.ByteString.

    Buffer the body as a simple akka.util.ByteString.

    Will buffer up to the configured max memory buffer amount, after which point, it will return an EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  11. def byteString(maxLength: Long): BodyParser[ByteString]

    Permalink

    Buffer the body as a simple akka.util.ByteString.

    Buffer the body as a simple akka.util.ByteString.

    maxLength

    Max length (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. val config: ParserConfiguration

    Permalink
  14. def createBadResult(msg: String, statusCode: Int = BAD_REQUEST): (RequestHeader) ⇒ Future[Result]

    Permalink
    Attributes
    protected
    Definition Classes
    PlayBodyParsers
  15. def default(maxLength: Option[Long]): BodyParser[AnyContent]

    Permalink

    If the request has a body, parse the body content by checking the Content-Type header.

    If the request has a body, parse the body content by checking the Content-Type header.

    Definition Classes
    PlayBodyParsers
  16. def default: BodyParser[AnyContent]

    Permalink

    If the request has a body, parse the body content by checking the Content-Type header.

    If the request has a body, parse the body content by checking the Content-Type header.

    Definition Classes
    PlayBodyParsers
  17. def defaultBodyParser: BodyParser[AnyContent]

    Permalink
    Definition Classes
    PlayBodyParsers
  18. def empty: BodyParser[Unit]

    Permalink

    Don't parse the body content.

    Don't parse the body content.

    Definition Classes
    BodyParserUtils
  19. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink

    A body parser that always returns an error.

    A body parser that always returns an error.

    Definition Classes
    BodyParserUtils
  22. val errorHandler: HttpErrorHandler

    Permalink
  23. 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.

    Definition Classes
    PlayBodyParsers
  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def flatten[A](underlying: Future[BodyParser[A]])(implicit ec: ExecutionContext, mat: Materializer): BodyParser[A]

    Permalink

    A body parser that flattens a future BodyParser.

    A body parser that flattens a future BodyParser.

    Definition Classes
    BodyParserUtils
  26. 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 (in bytes) 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

    Definition Classes
    PlayBodyParsers
  27. def formUrlEncoded: 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.

    Definition Classes
    PlayBodyParsers
  28. def formUrlEncoded(maxLength: Long): 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 (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  29. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    BodyParserUtils
  32. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  33. 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.

    Definition Classes
    PlayBodyParsers
  34. def json: 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.

    Definition Classes
    PlayBodyParsers
  35. def json(maxLength: Long): 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 (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  36. val materializer: Materializer

    Permalink
  37. 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

    Definition Classes
    BodyParserUtils
  38. 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.

    maxLength

    Max length (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
    See also

    Results.EntityTooLarge

    DefaultMaxDiskLength

  39. def multipartFormData(maxLength: Long): BodyParser[MultipartFormData[TemporaryFile]]

    Permalink

    Parse the content as multipart/form-data

    Parse the content as multipart/form-data

    maxLength

    Max length (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  40. def multipartFormData: BodyParser[MultipartFormData[TemporaryFile]]

    Permalink

    Parse the content as multipart/form-data

    Parse the content as multipart/form-data

    Definition Classes
    PlayBodyParsers
  41. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink

    Store the body content in a RawBuffer.

    Store the body content in a RawBuffer.

    Definition Classes
    PlayBodyParsers
  45. def raw(memoryThreshold: Long = 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.

    Definition Classes
    PlayBodyParsers
    See also

    Results.EntityTooLarge

    DefaultMaxDiskLength

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

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

    Permalink

    Store the body content into a temporary file.

    Store the body content into a temporary file.

    Definition Classes
    PlayBodyParsers
  48. val temporaryFileCreator: TemporaryFileCreator

    Permalink
  49. def text: 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.

    Definition Classes
    PlayBodyParsers
  50. def text(maxLength: Long): 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 (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  51. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  52. def tolerantBodyParser[A](name: String, maxLength: Long, errorMessage: String)(parser: (RequestHeader, ByteString) ⇒ A): BodyParser[A]

    Permalink

    Create a body parser that uses the given parser and enforces the given max length.

    Create a body parser that uses the given parser and enforces the given max length.

    name

    The name of the body parser.

    maxLength

    The maximum length of the body to buffer.

    errorMessage

    The error message to prepend to the exception message if an error was encountered.

    parser

    The parser.

    Attributes
    protected
    Definition Classes
    PlayBodyParsers
  53. def tolerantFormUrlEncoded: 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.

    Definition Classes
    PlayBodyParsers
  54. def tolerantFormUrlEncoded(maxLength: Long): 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 (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  55. def tolerantJson: BodyParser[JsValue]

    Permalink

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

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

    Definition Classes
    PlayBodyParsers
  56. def tolerantJson(maxLength: Long): 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 (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  57. def tolerantText: BodyParser[String]

    Permalink

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

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

    Definition Classes
    PlayBodyParsers
  58. 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 (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  59. def tolerantXml: BodyParser[NodeSeq]

    Permalink

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

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

    Definition Classes
    PlayBodyParsers
  60. def tolerantXml(maxLength: Long): 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 (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers
  61. def using[A](f: (RequestHeader) ⇒ BodyParser[A]): BodyParser[A]

    Permalink

    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.

    Definition Classes
    BodyParserUtils
  62. final def wait(): Unit

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

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

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

    Permalink

    Creates a conditional BodyParser.

    Creates a conditional BodyParser.

    Definition Classes
    BodyParserUtils
  66. def xml: 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.

    Definition Classes
    PlayBodyParsers
  67. def xml(maxLength: Long): 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 (in bytes) allowed or returns EntityTooLarge HTTP response.

    Definition Classes
    PlayBodyParsers

Deprecated Value Members

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

    Permalink
    Definition Classes
    PlayBodyParsers
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use formUrlEncoded

  2. def urlFormEncoded(maxLength: Long): BodyParser[Map[String, Seq[String]]]

    Permalink
    Definition Classes
    PlayBodyParsers
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use formUrlEncoded

Inherited from PlayBodyParsers

Inherited from BodyParserUtils

Inherited from AnyRef

Inherited from Any

Ungrouped