const mixinafBedSheet::HttpResponse

afBedSheet::HttpResponse

An injectable const version of WebRes.

This is proxied and will always refers to the current web response.

cookies

Source

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

Source

abstract Bool disableBuffering

Disables response buffering

@see BufferedOutStream

disableGzip

Source

abstract Bool disableGzip

Disables gzip compression for this response.

@see GzipOutStream

headers

Source

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. Throws Err if response is already committed.

@see

isCommitted

Source

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.

@see web::WebRes.isCommitted

out

Source

abstract OutStream out()

Returns the OutStream for this response. Should current settings allow, the OutStream is automatically gzipped.

@see web::WebRes.out

saveAsAttachment

Source

abstract Void saveAsAttachment(Str fileName)

Directs the client to display a save as dialog. Sets the Content-Disposition http response header.

Don't forget to set the Content-Type header too!

@see HttpResponseHeaders.contentDisposition

statusCode

Source

abstract Int statusCode

Set the HTTP status code for this response.

@see web::WebRes.statusCode