the response header, which contains status code and HTTP headers
the response body
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.
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
Convert this result to a Java result.
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.
the response body
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
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
Example:
Example:
Ok.removingFromSession("foo")
Keys to remove from session
Current request
A copy of this result with keys
removed from its session scope.
Current request
The session carried by this result. Reads the request’s session if this result does not modify the session.
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"))
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
the headers with a DateTime 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
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
A simple result, which defines the response header and a body ready to send to the client.
the response header, which contains status code and HTTP headers
the response body