HttpHeaders

Maintains a set of output headers. These are held in an output buffer, and indexed via a HttpStack. Deleting a header could be supported by setting the HttpStack entry to null, and ignoring such values when it's time to write the headers.

Constructors

this
this()

Construct output headers

this
this(HttpHeaders source)

Clone a source set of HttpHeaders

Members

Functions

add
void add(HttpHeaderName name, void delegate(OutputBuffer) dg)

Add the specified header, and use a callback to provide the content.

add
void add(HttpHeaderName name, cstring value)

Add the specified header and text

addDate
void addDate(HttpHeaderName name, Time value)

Add the specified header and long/date value

addInt
void addInt(HttpHeaderName name, int value)

Add the specified header and integer value

clone
HttpHeaders clone()

Clone this set of HttpHeaders

remove
bool remove(HttpHeaderName name)

Remove the specified header header. Returns false if not found.

Inherited Members

From HttpHeadersView

parse
alias parse = HttpTokens.parse
Undocumented in source.
clone
HttpHeadersView clone()

Clone this set of HttpHeadersView

retain
HttpHeadersView retain(bool yes)

Control whether headers are duplicated or not. Default behaviour is aliasing instead of copying, avoiding any allocation overhead. However, the default won't preserve those headers once additional content has been read.

parse
void parse(InputBuffer input)

Read all header lines. Everything is mapped rather than being allocated & copied

get
cstring get(HttpHeaderName name, cstring def)

Return the value of the provided header, or null if the header does not exist

getInt
int getInt(HttpHeaderName name, int def)

Return the integer value of the provided header, or -1 if the header does not exist

getDate
Time getDate(HttpHeaderName name, Time def)

Return the date value of the provided header, or Time.epoch if the header does not exist

opApply
int opApply(int delegate(ref HeaderElement) dg)

Iterate over the set of headers. This is a shell around the superclass, where we can convert the HttpToken into a HeaderElement instead.

createFilter
FilteredHeaders createFilter(HttpHeaderName header)

Create a filter for iterating of a set of named headers. We have to create a filter since we can't pass additional arguments directly to an opApply() method.

Meta