play.api.mvc.Results

Status

class Status extends SimpleResult

Generates default SimpleResult from a content type, headers and content.

Source
Results.scala
Linear Supertypes
SimpleResult, Serializable, Serializable, Product, Equals, PlainResult, Result, WithHeaders[PlainResult], NotNull, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Status
  2. SimpleResult
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. PlainResult
  8. Result
  9. WithHeaders
  10. NotNull
  11. AnyRef
  12. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Status(status: Int)

    status

    the HTTP response status, e.g ‘200 OK’

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def apply[C](content: C)(implicit writeable: Writeable[C]): SimpleResult

    Set the result's content.

    Set the result's content.

    content

    The content to send.

  7. def as(contentType: String): SimpleResult

    Changes the result content type.

    Changes the result content type.

    For example:

    Ok("Hello world").as("application/xml")
    contentType

    the new content type.

    returns

    the new result

    Definition Classes
    SimpleResultWithHeaders
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. val body: Enumerator[Array[Byte]]

    Definition Classes
    SimpleResult
  10. def chunked[C](content: Enumerator[C])(implicit writeable: Writeable[C]): SimpleResult

    Feed the content as the response, using chunked transfer encoding.

    Feed the content as the response, using chunked transfer encoding.

    Chunked transfer encoding is only supported for HTTP 1.1 clients. If the client is an HTTP 1.0 client, Play will instead return a 505 error code.

    Chunked encoding allows the server to send a response where the content length is not known, or for potentially infinite streams, while still allowing the connection to be kept alive and reused for the next request.

    content

    Enumerator providing the content to stream.

  11. def clearingLang(implicit app: Application): PlainResult

    Clears the user's language by discarding the language cookie set by withLang

    Clears the user's language by discarding the language cookie set by withLang

    For example:

    Ok(Messages("hello.world")).clearingLang
    returns

    the new result

    Definition Classes
    WithHeaders
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. val connection: Connection

    Definition Classes
    SimpleResult
  14. def discardingCookies(cookies: DiscardingCookie*): SimpleResult

    Discards cookies along this result.

    Discards cookies along this result.

    For example:

    Ok("Hello world").discardingCookies("theme")
    cookies

    the cookies to discard along to this result

    returns

    the new result

    Definition Classes
    SimpleResultWithHeaders
  15. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. def feed[C](content: Enumerator[C])(implicit writeable: Writeable[C]): SimpleResult

    Feed the content as the response.

    Feed the content as the response.

    The connection will be closed after the response is sent, regardless of whether there is a content length or transfer encoding defined.

    content

    Enumerator providing the content to stream.

  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def flashing(values: (String, String)*): SimpleResult

    Adds values to the flash scope for this result.

    Adds values to the flash scope for this result.

    For example:

    Ok("Hello world").flashing("success" -> "Done!")
    values

    the flash values to set with this result

    returns

    the new result

    Definition Classes
    SimpleResultWithHeaders
  19. def flashing(flash: Flash): SimpleResult

    Adds values to the flash scope for this result.

    Adds values to the flash scope for this result.

    For example:

    Ok("Hello world").flashing(flash + ("success" -> "Done!"))
    flash

    the flash scope to set with this result

    returns

    the new result

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

    Definition Classes
    AnyRef → Any
  21. val header: ResponseHeader

    The response header

    The response header

    Definition Classes
    SimpleResultPlainResult
  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. def sendFile(content: File, inline: Boolean = false, fileName: (File) ⇒ String = _.getName, onClose: () ⇒ Unit = () => ()): SimpleResult

    Send a file.

    Send a file.

    content

    The file to send.

    inline

    Use Content-Disposition inline or attachment.

    fileName

    function to retrieve the file name (only used for Content-Disposition attachment).

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

    Definition Classes
    AnyRef
  28. def toString(): String

    Definition Classes
    SimpleResult → AnyRef → Any
  29. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def withCookies(cookies: Cookie*): SimpleResult

    Adds cookies to this result.

    Adds cookies to this result.

    For example:

    Ok("Hello world").withCookies(Cookie("theme", "blue"))
    cookies

    the cookies to add to this result

    returns

    the new result

    Definition Classes
    SimpleResultWithHeaders
  33. def withHeaders(headers: (String, String)*): SimpleResult

    Adds headers to this result.

    Adds headers to this result.

    For example:

    Ok("Hello world").withHeaders(ETAG -> "0")
    headers

    the headers to add to this result.

    returns

    the new result

    Definition Classes
    SimpleResultWithHeaders
  34. def withLang(lang: Lang)(implicit app: Application): PlainResult

    Sets the user's language permanently for future requests by storing it in a cookie.

    Sets the user's language permanently for future requests by storing it in a cookie.

    For example:

    implicit val lang = Lang("fr-FR")
    Ok(Messages("hello.world")).withLang(lang)
    lang

    the language to store for the user

    returns

    the new result

    Definition Classes
    WithHeaders
  35. def withNewSession: SimpleResult

    Discards the existing session for this result.

    Discards the existing session for this result.

    For example:

    Ok("Hello world").withNewSession
    returns

    the new result

    Definition Classes
    SimpleResultWithHeaders
  36. def withSession(session: (String, String)*): SimpleResult

    Sets a new session for this result, discarding the existing session.

    Sets a new session for this result, discarding the existing session.

    For example:

    Ok("Hello world").withSession("saidHello" -> "yes")
    session

    the session to set with this result

    returns

    the new result

    Definition Classes
    SimpleResultWithHeaders
  37. def withSession(session: Session): SimpleResult

    Sets a new session for this result.

    Sets a new session for this result.

    For example:

    Ok("Hello world").withSession(session + ("saidHello" -> "true"))
    session

    the session to set with this result

    returns

    the new result

    Definition Classes
    SimpleResultWithHeaders

Deprecated Value Members

  1. def discardingCookies(name: String, names: String*): PlainResult

    Discards cookies along this result.

    Discards cookies along this result.

    For example:

    Ok("Hello world").discardingCookies("theme")
    names

    the names of the cookies to discard along to this result

    returns

    the new result

    Definition Classes
    WithHeaders
    Annotations
    @deprecated
    Deprecated

    (Since version 2.1) This method can only discard cookies on the / path with no domain and without secure set. Use discardingCookies(DiscardingCookie*) instead.

  2. def stream[C](content: (Iteratee[C, Unit]) ⇒ Unit)(implicit writeable: Writeable[C]): ChunkedResult[C]

    Set the result's content as chunked.

    Set the result's content as chunked.

    content

    A function that will give you the Iteratee to write in once ready.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2.0) Use stream(Enumerator) instead. Will be removed in Play 2.3.

  3. def stream[C](content: Enumerator[C])(implicit writeable: Writeable[C]): SimpleResult

    Stream the results content as chunked.

    Stream the results content as chunked.

    content

    Enumerator providing the content to stream.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use Status.chunked instead

Inherited from SimpleResult

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from PlainResult

Inherited from Result

Inherited from WithHeaders[PlainResult]

Inherited from NotNull

Inherited from AnyRef

Inherited from Any

Ungrouped