Class

play.api.mvc.Results

Status

Related Doc: package Results

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Status(status: Int)

    Permalink

    status

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

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 addingToSession(values: (String, String)*)(implicit request: RequestHeader): Result

    Permalink

    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
  5. def apply[C](content: C)(implicit writeable: Writeable[C]): Result

    Permalink

    Set the result's content.

    Set the result's content.

    content

    The content to send.

  6. def as(contentType: String): Result

    Permalink

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

    Permalink
    Definition Classes
    Any
  8. def asJava: mvc.Result

    Permalink

    Convert this result to a Java result.

    Convert this result to a Java result.

    Definition Classes
    Result
  9. def bakeCookies(cookieHeaderEncoding: CookieHeaderEncoding = new DefaultCookieHeaderEncoding(), sessionBaker: CookieBaker[Session] = new DefaultSessionCookieBaker(), flashBaker: CookieBaker[Flash] = new DefaultFlashCookieBaker(), requestHasFlash: Boolean = false): Result

    Permalink

    Encode the cookies into the Set-Cookie header.

    Encode the cookies into the Set-Cookie header. The session is always baked first, followed by the flash cookie, followed by all the other cookies in order.

    Definition Classes
    Result
  10. val body: HttpEntity

    Permalink

    the response body

    the response body

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

    Permalink

    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

    Source providing the content to stream.

  12. def clone(): AnyRef

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

    Permalink

    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
  14. def discardingHeader(name: String): Result

    Permalink

    Discards headers to this result.

    Discards headers to this result.

    For example:

    Ok("Hello world").discardingHeader(ETAG)
    returns

    the new result

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

    Permalink
    Definition Classes
    AnyRef
  16. def finalize(): Unit

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

    Permalink

    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
  18. def flashing(flash: Flash): Result

    Permalink

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. val header: ResponseHeader

    Permalink

    the response header, which contains status code and HTTP headers

    the response header, which contains status code and HTTP headers

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

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

    Permalink
    Definition Classes
    AnyRef
  23. val newCookies: Seq[Cookie]

    Permalink
    Definition Classes
    Result
  24. val newFlash: Option[Flash]

    Permalink
    Definition Classes
    Result
  25. val newSession: Option[Session]

    Permalink
    Definition Classes
    Result
  26. final def notify(): Unit

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

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

    Permalink

    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
  29. def sendEntity(entity: HttpEntity): Result

    Permalink

    Send an HTTP entity with this status.

  30. def sendFile(content: File, inline: Boolean = true, fileName: (File) ⇒ String = _.getName, onClose: () ⇒ Unit = () => ())(implicit ec: ExecutionContext, fileMimeTypes: FileMimeTypes): Result

    Permalink

    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. By default the name of the file is used.

  31. def sendPath(content: Path, inline: Boolean = true, fileName: (Path) ⇒ String = _.getFileName.toString, onClose: () ⇒ Unit = () => ())(implicit ec: ExecutionContext, fileMimeTypes: FileMimeTypes): Result

    Permalink

    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. By default the name of the file is used.

  32. def sendResource(resource: String, classLoader: ClassLoader = Results.getClass.getClassLoader, inline: Boolean = true)(implicit fileMimeTypes: FileMimeTypes): Result

    Permalink

    Send the given resource from the given classloader.

    Send the given resource from the given classloader.

    resource

    The path of the resource to load.

    classLoader

    The classloader to load it from, defaults to the classloader for this class.

    inline

    Whether it should be served as an inline file, or as an attachment.

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

    Permalink

    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
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def toString(): String

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

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

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

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

    Permalink

    Adds cookies to this result.

    Adds cookies to this result. If the result already contains cookies then cookies with the same name in the new list will override existing ones.

    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
  40. def withDateHeaders(headers: (String, ZonedDateTime)*): Result

    Permalink

    Add a header with a DateTime formatted using the default http date format

    Add a header with a DateTime formatted using the default http date format

    headers

    the headers with a DateTime to add to this result.

    returns

    the new result.

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

    Permalink

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

    Permalink

    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
  43. def withSession(session: (String, String)*): Result

    Permalink

    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
  44. def withSession(session: Session): Result

    Permalink

    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

Inherited from Result

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped