(Service) - An injectable
const version of WebRes.
This will always refers to the current web response.
abstract Bool disableBuffering
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.
abstract Bool disableGzip
trueto disable gzip compression for this response.
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.
abstract Bool isCommitted()
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.
abstract OutStream out()
OutStreamfor this response. Should current settings allow, the
OutStreamis automatically gzipped.
Directs the client to display a
save asdialog by setting the
Content-DispositionHTTP response header.
Content-TypeHTTP response header is set to the MimeType derived from the fileName's extension.
abstract Int statusCode
Get / set the HTTP status code for this response. Setter throws Err if response is already committed.