HttpResponse

Constructors

this
this(size_t initial_buffer_size)

Constructor

Members

Classes

AppendHeaderLines
class AppendHeaderLines

Utility class; an instance is passed to addHeaders() to be used by a subclass to append a header line to the response message.

Functions

addHeaders
void addHeaders(AppendHeaderLines append)

Called by render() when a subclass may use append to add its response header lines.

minimizeContentBuffer
typeof(this) minimizeContentBuffer()

Sets the content buffer length to the lowest currently possible value.

render
cstring render(cstring msg_body, bool head)

Renders the response message, using the 200 "OK" status code. If a message body is provided, the "Content-Length" header field will be set and, if head is false, msg_body will be copied into an internal buffer.

render
cstring render(HttpResponseCode status, cstring msg_body, bool head)

Renders the response message. If a message body is provided, it is appended to the response message according to RFC 2616, section 4.3; that is, - If status is either below 200 or 204 or 304, neither a message body nor a "Content-Length" header field are appended. - Otherwise, if head is true, a "Content-Length" header field reflecting msg_body.length is appended but the message body itself is not. - Otherwise, if head is false, both a "Content-Length" header field reflecting msg_body.length and the message body itself are appended.

Inherited Members

From HttpHeader

IOBufferSize
enum int IOBufferSize;
Undocumented in source.
MaxPostParamSize
enum int MaxPostParamSize;
Undocumented in source.
Version
enum HttpHeaderName Version;
Undocumented in source.
TextHtml
enum HttpHeaderName TextHtml;
Undocumented in source.
Accept
enum HttpHeaderName Accept;
Undocumented in source.
AcceptCharset
enum HttpHeaderName AcceptCharset;
Undocumented in source.
AcceptEncoding
enum HttpHeaderName AcceptEncoding;
Undocumented in source.
AcceptLanguage
enum HttpHeaderName AcceptLanguage;
Undocumented in source.
AcceptRanges
enum HttpHeaderName AcceptRanges;
Undocumented in source.
Age
enum HttpHeaderName Age;
Undocumented in source.
Allow
enum HttpHeaderName Allow;
Undocumented in source.
Authorization
enum HttpHeaderName Authorization;
Undocumented in source.
CacheControl
enum HttpHeaderName CacheControl;
Undocumented in source.
Connection
enum HttpHeaderName Connection;
Undocumented in source.
ContentEncoding
enum HttpHeaderName ContentEncoding;
Undocumented in source.
ContentLanguage
enum HttpHeaderName ContentLanguage;
Undocumented in source.
ContentLength
enum HttpHeaderName ContentLength;
Undocumented in source.
ContentLocation
enum HttpHeaderName ContentLocation;
Undocumented in source.
ContentRange
enum HttpHeaderName ContentRange;
Undocumented in source.
ContentType
enum HttpHeaderName ContentType;
Undocumented in source.
Cookie
enum HttpHeaderName Cookie;
Undocumented in source.
Date
enum HttpHeaderName Date;
Undocumented in source.
ETag
enum HttpHeaderName ETag;
Undocumented in source.
Expect
enum HttpHeaderName Expect;
Undocumented in source.
Expires
enum HttpHeaderName Expires;
Undocumented in source.
From
enum HttpHeaderName From;
Undocumented in source.
Host
enum HttpHeaderName Host;
Undocumented in source.
Identity
enum HttpHeaderName Identity;
Undocumented in source.
IfMatch
enum HttpHeaderName IfMatch;
Undocumented in source.
IfModifiedSince
enum HttpHeaderName IfModifiedSince;
Undocumented in source.
IfNoneMatch
enum HttpHeaderName IfNoneMatch;
Undocumented in source.
IfRange
enum HttpHeaderName IfRange;
Undocumented in source.
IfUnmodifiedSince
enum HttpHeaderName IfUnmodifiedSince;
Undocumented in source.
KeepAlive
enum HttpHeaderName KeepAlive;
Undocumented in source.
LastModified
enum HttpHeaderName LastModified;
Undocumented in source.
Location
enum HttpHeaderName Location;
Undocumented in source.
MaxForwards
enum HttpHeaderName MaxForwards;
Undocumented in source.
MimeVersion
enum HttpHeaderName MimeVersion;
Undocumented in source.
Pragma
enum HttpHeaderName Pragma;
Undocumented in source.
ProxyAuthenticate
enum HttpHeaderName ProxyAuthenticate;
Undocumented in source.
ProxyConnection
enum HttpHeaderName ProxyConnection;
Undocumented in source.
Range
enum HttpHeaderName Range;
Undocumented in source.
Referrer
enum HttpHeaderName Referrer;
Undocumented in source.
RetryAfter
enum HttpHeaderName RetryAfter;
Undocumented in source.
Server
enum HttpHeaderName Server;
Undocumented in source.
ServletEngine
enum HttpHeaderName ServletEngine;
Undocumented in source.
SetCookie
enum HttpHeaderName SetCookie;
Undocumented in source.
SetCookie2
enum HttpHeaderName SetCookie2;
Undocumented in source.
TE
enum HttpHeaderName TE;
Undocumented in source.
Trailer
enum HttpHeaderName Trailer;
Undocumented in source.
TransferEncoding
enum HttpHeaderName TransferEncoding;
Undocumented in source.
Upgrade
enum HttpHeaderName Upgrade;
Undocumented in source.
UserAgent
enum HttpHeaderName UserAgent;
Undocumented in source.
Vary
enum HttpHeaderName Vary;
Undocumented in source.
Warning
enum HttpHeaderName Warning;
Undocumented in source.
WwwAuthenticate
enum HttpHeaderName WwwAuthenticate;
Undocumented in source.

Meta