const mixinafBedSheet::HttpResponse
afBedSheet::HttpResponse
(Service) - An injectable const version of WebRes.
This will always refers to the current web response.
- disableBuffering
abstract Bool disableBufferingSet to
trueto disable buffering for this response.Buffered responses contain a
Content-Lengthheader and are easier to process by clients. Non buffered responses are streamed straight out to the client.- disableGzip
abstract Bool disableGzipSet to
trueto disable gzip compression for this response.- headers
abstract HttpResponseHeaders headers()Map of HTTP response headers. You must set all headers before you access out() for the first time, which commits the response.
@see
- isCommitted
abstract Bool isCommitted()Return true if this response has been committed. 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.
- onCommit
abstract Void onCommit(|HttpResponse fn)Adds an event handler that gets called just before a session is committed. Use to make last minute changes to header values.
Callbacks may be mutable, do not need to be cleaned up, but should be added at the start of every HTTP request.
- out
abstract OutStream out()Returns the
OutStreamfor this response. Should current settings allow, theOutStreamis automatically gzipped.@see web::WebRes.out
- saveAsAttachment
abstract Void saveAsAttachment(Str fileName)Directs the client to display a
save asdialog by setting theContent-DispositionHTTP response header.The
Content-TypeHTTP response header is set to the MimeType derived from the fileName's extension.- statusCode
abstract Int statusCodeGet / set the HTTP status code for this response. Setter throws Err if response is already committed.
- statusMsg
const static Int:Str statusMsg := ...Map of HTTP status codes to status messages.
See WebRes.statusMsg.