Class HTTPServerResponse
Represents a HTTP response as sent from the server side.
Constructors
Name | Description |
this
(conn, raw_connection, settings, req_alloc)
|
|
this
(conn, raw_connection, settings, req_alloc)
|
|
Properties
Name | Type | Description |
bodyWriter [get]
|
vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.OutputStream) | A stream for writing the body of the HTTP response.
|
bytesWritten [get]
|
ulong | |
connected [get]
|
bool | Determines if the underlying connection is still alive.
|
headerWritten [get]
|
bool | Determines if the HTTP header has already been written.
|
timeFinalized [get]
|
std.datetime.systime.SysTime | Returns the time at which the request was finalized.
|
contentType [get, set]
|
string | Shortcut to the "Content-Type" header
|
cookies [get]
|
DictionaryList!(vibe.http.common.Cookie,true,32L,false) | All cookies that shall be set on the client for this request
|
Methods
Name | Description |
connectProxy
()
|
Special method for handling CONNECT proxy tunnel
|
finalize
()
|
Finalizes the response. This is usually called automatically by the server.
|
isHeadResponse
()
|
Determines if the response does not need a body.
|
redirect
(url, status)
|
Sends a redirect request to the client.
|
setCookie
(name, value, path, encoding)
|
Sets the specified cookie value.
|
startSession
(path)
|
Initiates a new session.
|
switchProtocol
(protocol)
|
Special method sending a SWITCHING_PROTOCOLS response to the client.
|
terminateSession
()
|
Terminates the current session (if any).
|
tls
()
|
Determines if the response is sent over an encrypted connection.
|
waitForConnectionClose
(timeout)
|
Waits until either the connection closes, data arrives, or until the
given timeout is reached.
|
writeBody
(data, content_type)
|
Writes the entire response body at once.
|
writeBody
(data, content_type)
|
Writes the entire response body as a single string.
|
writeJsonBody
(data, status, allow_chunked)
|
Writes a JSON message with the specified status
|
writePrettyJsonBody
(data, allow_chunked)
|
Writes a JSON message with the specified status
|
writeRawBody
(stream)
|
Writes the whole response body at once, without doing any further encoding.
|
writeVoidBody
()
|
Writes the response with no body.
|
toString
()
|
|