Example:
Example:
Ok.addingToSession("foo" -> "bar").addingToSession("baz" -> "bah")
(key -> value) pairs to add to this result’s session
Current request
A copy of this result with values
added to its session scope.
Set the result's content.
Set the result's content.
The content to send.
Changes the result content type.
Changes the result content type.
For example:
Ok("Hello world ").as("application/xml")
the new content type.
the new result
the response body
the response body
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.
Enumerator providing the content to stream.
the connection semantics to use
the connection semantics to use
Discards cookies along this result.
Discards cookies along this result.
For example:
Redirect(routes.Application.index()).discardingCookies("theme")
the cookies to discard along to this result
the new 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.
Enumerator providing the content to stream.
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!")
the flash values to set with this result
the new 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!"))
the flash scope to set with this result
the new result
the response header, which contains status code and HTTP headers
the response header, which contains status code and HTTP headers
Example:
Example:
Ok.removingFromSession("foo")
Keys to remove from session
Current request
A copy of this result with keys
removed from its session scope.
Send a file.
Send a file.
The file to send.
Use Content-Disposition inline or attachment.
Function to retrieve the file name (only used for Content-Disposition attachment).
Send a file.
Send a file.
The file to send.
Use Content-Disposition inline or attachment.
Function to retrieve the file name (only used for Content-Disposition attachment).
Send the given resource from the given classloader.
Send the given resource from the given classloader.
The path of the resource to load.
The classloader to load it from, defaults to the classloader for this class.
Whether it should be served as an inline file, or as an attachment.
Current request
The session carried by this result. Reads the request’s session if this result does not modify the session.
Stream the content as the response.
Stream the content as the response.
If a content length is set, this will send the body as is, otherwise it may chunk or may not chunk depending on whether HTTP/1.1 is used or not.
Enumerator providing the content to stream.
Adds cookies to this result.
Adds cookies to this result. If the result already contains cookies then the new cookies will be merged with the old cookies.
For example:
Redirect(routes.Application.index()).withCookies(Cookie("theme", "blue"))
the cookies to add to this result
the new result
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
Adds headers to this result.
Adds headers to this result.
For example:
Ok("Hello world").withHeaders(ETAG -> "0")
the headers to add to this result.
the new result
Discards the existing session for this result.
Discards the existing session for this result.
For example:
Redirect(routes.Application.index()).withNewSession
the new 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")
the session to set with this result
the new 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"))
the session to set with this result
the new result
Generates default
Result
from a content type, headers and content.