HttpResponseOutputStream

A wrapper around a byte output stream that's used for writing HTTP response content. It keeps a reference to the ServerHttpResponse so that when a handler writes data to the stream, it'll flush the HTTP response status and headers beforehand.

Constructors

this
this(S outputStream, ServerHttpResponse* response)
Undocumented in source.

Members

Functions

areHeadersFlushed
bool areHeadersFlushed()

Determines if the HTTP response headers have been flushed to the underlying output stream.

writeHeaders
StreamResult writeHeaders()

Writes HTTP/1.1 status line and headers to the underlying output stream, which is done before any body content can be written.

writeToStream
StreamResult writeToStream(ubyte[] buffer)

Writes the given data to the stream. If the referenced HTTP response's status and headers haven't yet been written, they will be written first.