play.api.mvc.Results

Status

class Status extends SimpleResult[EmptyContent]

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

Source
Results.scala
Linear Supertypes
SimpleResult[EmptyContent], 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’

Type Members

  1. type BODY_CONTENT = EmptyContent

    The body content type.

    The body content type.

    Definition Classes
    SimpleResult

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[C]

    Set the result's content.

    Set the result's content.

    C

    the content type

    content

    content to send

  7. def as(contentType: String): PlainResult

    Changes the result content type.

    Changes the result content type.

    For example:

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

    the new content type.

    returns

    the new result

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

    Definition Classes
    Any
  9. val body: Enumerator[EmptyContent]

    Definition Classes
    SimpleResult
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def discardingCookies(cookies: DiscardingCookie*): PlainResult

    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
    PlainResultWithHeaders
  12. final def eq(arg0: AnyRef): Boolean

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

    Feed the given enumerator as a plain response.

    Feed the given enumerator as a plain response.

    Note that this method will result in no Content-Length header being set, and consequently when the enumerator has finished, the connection will be closed, as this is the only way to terminate a response that isn't chunked and doesn't set a content length header.

    content

    The content to stream

    returns

    a simple result

  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. def flashing(values: (String, String)*): PlainResult

    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!")
    returns

    the new result

    Definition Classes
    PlainResultWithHeaders
  16. def flashing(flash: Flash): PlainResult

    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
    PlainResultWithHeaders
  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. val header: ResponseHeader

    The response header

    The response header

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

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

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

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

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

    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)

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

    Invoke the given function to allow a response to be streamed to the response iteratee.

    Invoke the given function to allow a response to be streamed to the response iteratee.

    content

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

    returns

    a ChunkedResult

  25. def stream[C](content: Enumerator[C])(implicit writeable: Writeable[C]): ChunkedResult[C]

    Stream the given enumerator as a chunked response.

    Stream the given enumerator as a chunked response.

    content

    Enumerator providing the chunked content.

    returns

    a ChunkedResult

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

    Definition Classes
    AnyRef
  27. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. def withCookies(cookies: Cookie*): PlainResult

    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
    PlainResultWithHeaders
  32. def withHeaders(headers: (String, String)*): SimpleResult[EmptyContent]

    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
  33. def withLang(lang: Lang)(implicit app: Application): PlainResult

    Sets the users language permanently for future requests by storing it in a cookie.

    Sets the users 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
  34. def withNewSession: PlainResult

    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
    PlainResultWithHeaders
  35. def withSession(session: (String, String)*): PlainResult

    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
    PlainResultWithHeaders
  36. def withSession(session: Session): PlainResult

    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
    PlainResultWithHeaders
  37. implicit val writeable: Writeable[EmptyContent]

    Definition Classes
    SimpleResult

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.

Inherited from SimpleResult[EmptyContent]

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