- connectProxy
ConnectionStream connectProxy()
void connectProxy(void delegate(scope ConnectionStream) @(safe) del)
Special method for handling CONNECT proxy tunnel
- finalize
void finalize()
Finalizes the response. This is usually called automatically by the server.
- isHeadResponse
bool isHeadResponse()
Determines if the response does not need a body.
- redirect
void redirect(string url, int status)
void redirect(URL url, int status)
Sends a redirect request to the client.
- setCookie
Cookie setCookie(string name, string value, string path, Cookie.Encoding encoding)
Sets the specified cookie value.
- startSession
Session startSession(string path)
Session startSession(string path, SessionOption options)
- switchProtocol
ConnectionStream switchProtocol(string protocol)
void switchProtocol(string protocol, void delegate(scope ConnectionStream) @(safe) del)
Special method sending a SWITCHING_PROTOCOLS response to the client.
- terminateSession
void terminateSession()
Terminates the current session (if any).
- tls
bool tls()
Determines if the response is sent over an encrypted connection.
- waitForConnectionClose
bool waitForConnectionClose(Duration timeout)
Waits until either the connection closes, data arrives, or until the
given timeout is reached.
- writeBody
void writeBody(ubyte[] data, string content_type)
void writeBody(ubyte[] data, int status, string content_type)
void writeBody(InputStream data, string content_type)
Writes the entire response body at once.
- writeBody
void writeBody(string data, string content_type)
void writeBody(string data, int status, string content_type)
Writes the entire response body as a single string.
- writeJsonBody
void writeJsonBody(T data, int status, bool allow_chunked)
void writeJsonBody(T data, int status, string content_type, bool allow_chunked)
void writeJsonBody(T data, string content_type, bool allow_chunked)
void writeJsonBody(T data, bool allow_chunked)
- writePrettyJsonBody
void writePrettyJsonBody(T data, bool allow_chunked)
Writes a JSON message with the specified status
- writeRawBody
void writeRawBody(RandomAccessStream stream)
void writeRawBody(InputStream stream, size_t num_bytes)
void writeRawBody(RandomAccessStream stream, int status)
void writeRawBody(InputStream stream, int status, size_t num_bytes)
Writes the whole response body at once, without doing any further encoding.
- writeVoidBody
void writeVoidBody()
Writes the response with no body.
Represents a HTTP response as sent from the server side.