play.api.mvc.Results

Status

class Status extends Result

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

Source
Results.scala
Linear Supertypes
Result, Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Status
  2. Result
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. 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 addingToSession(values: (String, String)*)(implicit request: RequestHeader): Result

    Example:

    Example:

    Ok.addingToSession("foo" -> "bar").addingToSession("baz" -> "bah")
    values

    (key -> value) pairs to add to this result’s session

    request

    Current request

    returns

    A copy of this result with values added to its session scope.

    Definition Classes
    Result
  7. def apply[C](content: C)(implicit writeable: Writeable[C]): Result

    Set the result's content.

    Set the result's content.

    content

    The content to send.

  8. def as(contentType: String): Result

    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
    Result
  9. final def asInstanceOf[T0]: T0

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

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

    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.

  12. def clearingLang(implicit app: Application): Result

    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
    Result
  13. def clone(): AnyRef

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

    Definition Classes
    Result
  15. def discardingCookies(cookies: DiscardingCookie*): Result

    Discards cookies along this result.

    Discards cookies along this result.

    For example:

    Redirect(routes.Application.index()).discardingCookies("theme")
    cookies

    the cookies to discard along to this result

    returns

    the new result

    Definition Classes
    Result
  16. final def eq(arg0: AnyRef): Boolean

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

    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.

  18. def finalize(): Unit

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

    Adds values to the flash scope for this result.

    Adds values to the flash scope for this result.

    For example:

    Redirect(routes.Application.index()).flashing("success" -> "Done!")
    values

    the flash values to set with this result

    returns

    the new result

    Definition Classes
    Result
  20. def flashing(flash: Flash): Result

    Adds values to the flash scope for this result.

    Adds values to the flash scope for this result.

    For example:

    Redirect(routes.Application.index()).flashing(flash + ("success" -> "Done!"))
    flash

    the flash scope to set with this result

    returns

    the new result

    Definition Classes
    Result
  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. val header: ResponseHeader

    Definition Classes
    Result
  23. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    AnyRef
  27. def removingFromSession(keys: String*)(implicit request: RequestHeader): Result

    Example:

    Example:

    Ok.removingFromSession("foo")
    keys

    Keys to remove from session

    request

    Current request

    returns

    A copy of this result with keys removed from its session scope.

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

    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).

  29. def session(implicit request: RequestHeader): Session

    request

    Current request

    returns

    The session carried by this result. Reads the request’s session if this result does not modify the session.

    Definition Classes
    Result
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def toString(): String

    Definition Classes
    Result → AnyRef → Any
  32. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def withCookies(cookies: Cookie*): Result

    Adds cookies to this result.

    Adds cookies to this result.

    For example:

    Redirect(routes.Application.index()).withCookies(Cookie("theme", "blue"))
    cookies

    the cookies to add to this result

    returns

    the new result

    Definition Classes
    Result
  36. def withHeaders(headers: (String, String)*): Result

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

    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
    Result
  38. def withNewSession: Result

    Discards the existing session for this result.

    Discards the existing session for this result.

    For example:

    Redirect(routes.Application.index()).withNewSession
    returns

    the new result

    Definition Classes
    Result
  39. def withSession(session: (String, String)*): Result

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

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

    For example:

    Redirect(routes.Application.index()).withSession("saidHello" -> "yes")
    session

    the session to set with this result

    returns

    the new result

    Definition Classes
    Result
  40. def withSession(session: Session): Result

    Sets a new session for this result.

    Sets a new session for this result.

    For example:

    Redirect(routes.Application.index()).withSession(session + ("saidHello" -> "true"))
    session

    the session to set with this result

    returns

    the new result

    Definition Classes
    Result

Deprecated Value Members

  1. def stream[C](content: Enumerator[C])(implicit writeable: Writeable[C]): Result

    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 Result

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped