The body content type.
The body content type.
Set the result's content.
Set the result's content.
the content type
content to send
Changes the result content type.
Changes the result content type.
For example:
Ok("Hello world ").as("text/xml")
the new content type.
the new result
Discards cookies along this result.
Discards cookies along this result.
For example:
Ok("Hello world").discardingCookies("theme")
the cookies to discard along to this result
the new result
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.
The content to stream
a simple result
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!")
the new result
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!"))
the flash scope to set with this result
the new result
The response header
The response header
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)
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.
A function that will give you the Iteratee to write in once ready.
a ChunkedResult
Stream the given enumerator as a chunked response.
Stream the given enumerator as a chunked response.
Enumerator providing the chunked content.
a ChunkedResult
Adds cookies to this result.
Adds cookies to this result.
For example:
Ok("Hello world").withCookies(Cookie("theme", "blue"))
the cookies to add to this result
the new result
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
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)
the language to store for the user
the new result
Discards the existing session for this result.
Discards the existing session for this result.
For example:
Ok("Hello world").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:
Ok("Hello world").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:
Ok("Hello world").withSession(session + ("saidHello" -> "true"))
the session to set with this result
the new result
Discards cookies along this result.
Discards cookies along this result.
For example:
Ok("Hello world").discardingCookies("theme")
the names of the cookies to discard along to this result
the new result
(Since version 2.1) This method can only discard cookies on the / path with no domain and without secure set. Use discardingCookies(DiscardingCookie*) instead.
Generates default
SimpleResult
from a content type, headers and content.