const mixinafBedSheet::Response
afBedSheet::Response
An injectable const
version of WebRes.
This is proxied and always refers to the current request
abstract Cookie[] cookies()
Get the list of cookies to set via header fields. Add a Cookie to this list to set a cookie. Throw Err if response is already committed.
Example:
res.cookies.add(Cookie("foo", "123")) res.cookies.add(Cookie("persistent", "some val") { maxAge = 3day })
@see web::WebRes.cookies
- headers
Map of HTTP response headers. You must set all headers before you access out() for the first time, which commits the response. Throw an err if response is already committed.
@see web::WebRes.headers
- isCommitted
abstract Bool isCommitted()
Return true if this response has been commmited. A committed response has written its response headers, and can no longer modify its status code or headers. A response is committed the first time that out is called.
- out
abstract OutStream out()
Returns the
OutStream
for this response. Should current settings allow, theOutStream
is automatically gzipped.@see web::WebRes.out
- redirect
abstract Void redirect(Uri uri, Int statusCode)
Send a redirect response to the client using the specified status code and url.
@see web::WebRes.redirect
- setStatusCode
abstract Void setStatusCode(Int statusCode)
Set the HTTP status code for this response.