const mixinafBedSheet::HttpResponse
afBedSheet::HttpResponse
An injectable const version of WebRes.
This is proxied and will always refers to the current web response.
abstract Cookie[] cookies()Get the list of cookies to set via header fields. Add a Cookie to this list to set a cookie. Throws 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
- disableBuffering
abstract Void disableBuffering()Disables response buffering
@see BufferedOutStream
- disableGzip
abstract Void disableGzip()Disables gzip compression for this response.
@see GzipOutStream
- headers
Map of HTTP response headers. You must set all headers before you access out() for the first time, which commits the response. Throws Err if response is already committed.
@see
- isBufferingDisabled
abstract Bool isBufferingDisabled()Has response buffering been disabled for this response? Only returns
trueifdisableBuffering()has been called.@see BufferedOutStream
- 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.
- isGzipDisabled
abstract Bool isGzipDisabled()Has gzip compression been disabled for this response? Only returns
trueifdisableGzip()has been called.@see GzipOutStream
- out
abstract OutStream out()Returns the
OutStreamfor this response. Should current settings allow, theOutStreamis automatically gzipped.@see web::WebRes.out
- setStatusCode
abstract Void setStatusCode(Int statusCode)Set the HTTP status code for this response.