HttpResponseEx

HttpResponse with some code to ease creating responses

Members

Functions

cacheForever
void cacheForever()
Undocumented in source. Be warned that the author may not have intended to support it.
disableCache
void disableCache()
Undocumented in source. Be warned that the author may not have intended to support it.
dup
HttpResponseEx dup()
Undocumented in source. Be warned that the author may not have intended to support it.
redirect
HttpResponseEx redirect(string location, HttpStatusCode status)

Redirect the UA to another location

serveData
HttpResponseEx serveData(string data, string contentType)
Undocumented in source. Be warned that the author may not have intended to support it.
serveData
HttpResponseEx serveData(Data[] data, string contentType)
Undocumented in source. Be warned that the author may not have intended to support it.
serveData
HttpResponseEx serveData(Data data, string contentType)
Undocumented in source. Be warned that the author may not have intended to support it.
serveFile
HttpResponseEx serveFile(string path, string fsBase, bool enableIndex, string urlBase)

Send a file from the disk

serveJson
HttpResponseEx serveJson(T v)
Undocumented in source. Be warned that the author may not have intended to support it.
serveText
HttpResponseEx serveText(string data)
Undocumented in source. Be warned that the author may not have intended to support it.
setRefresh
void setRefresh(int seconds, string location)
Undocumented in source. Be warned that the author may not have intended to support it.
writeError
HttpResponseEx writeError(HttpStatusCode code, string details)
Undocumented in source. Be warned that the author may not have intended to support it.
writePage
void writePage(string title, string[] html)
Undocumented in source. Be warned that the author may not have intended to support it.
writePageContents
void writePageContents(string title, string contentHTML)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

checkPath
bool checkPath(string path)
Undocumented in source. Be warned that the author may not have intended to support it.
getStatusExplanation
string getStatusExplanation(HttpStatusCode code)
Undocumented in source. Be warned that the author may not have intended to support it.
loadTemplate
string loadTemplate(string filename, string[string] dictionary)
Undocumented in source. Be warned that the author may not have intended to support it.
parseTemplate
string parseTemplate(string data, string[string] dictionary)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

contentTemplate
auto contentTemplate;
Undocumented in source.
errorTemplate
auto errorTemplate;
Undocumented in source.
pageTemplate
auto pageTemplate;
Undocumented in source.

Variables

jsonCallback
string jsonCallback;
Undocumented in source.

Inherited Members

From HttpResponse

status
HttpStatusCode status;
Undocumented in source.
statusMessage
string statusMessage;
Undocumented in source.
compressionLevel
int compressionLevel;
Undocumented in source.
getStatusMessage
string getStatusMessage(HttpStatusCode code)
Undocumented in source. Be warned that the author may not have intended to support it.
setStatus
void setStatus(HttpStatusCode code)

Set the response status code and message

parseStatusLine
void parseStatusLine(string statusLine)
Undocumented in source. Be warned that the author may not have intended to support it.
getContent
Data getContent()

If the data is compressed, return the decompressed data

compressWithDeflate
void compressWithDeflate()
Undocumented in source. Be warned that the author may not have intended to support it.
compressWithGzip
void compressWithGzip()
Undocumented in source. Be warned that the author may not have intended to support it.
optimizeData
void optimizeData(Headers requestHeaders)

Called by the server to compress content, if possible/appropriate

sliceData
void sliceData(Headers requestHeaders)

Called by the server to apply range request.

Meta