HttpFields

HTTP Fields. A collection of HTTP header and or Trailer fields.

<p> This class is not synchronized as it is expected that modifications will only be performed by a single thread.

<p> The cookie handling provided by this class is guided by the Servlet specification and RFC6265.

class HttpFields : Iterable!HttpField {}

Constructors

this
this()

Initialize an empty HttpFields.

this
this(int capacity)

Initialize an empty HttpFields.

this
this(HttpFields fields)

Initialize HttpFields from copy.

Members

Functions

add
void add(string name, string value)

Add to or set a field. If the field is allowed to have multiple values, add will add multiple headers of the same name.

add
void add(HttpHeader header, HttpHeaderValue value)
Undocumented in source. Be warned that the author may not have intended to support it.
add
void add(HttpHeader header, string value)

Add to or set a field. If the field is allowed to have multiple values, add will add multiple headers of the same name.

add
void add(HttpField field)
Undocumented in source. Be warned that the author may not have intended to support it.
add
void add(HttpFields fields)

Add fields from another HttpFields instance. Single valued fields are replaced, while all others are added.

addAll
void addAll(HttpFields fields)
Undocumented in source. Be warned that the author may not have intended to support it.
addCSV
bool addCSV(string name, string[] values)

Add comma separated values, but only if not already present.

addCSV
string addCSV(QuotedCSV existing, string[] values)
Undocumented in source. Be warned that the author may not have intended to support it.
addDateField
void addDateField(string name, long date)

Sets the value of a date field.

allFields
HttpField[] allFields()
Undocumented in source. Be warned that the author may not have intended to support it.
clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
contains
bool contains(HttpField field)
Undocumented in source. Be warned that the author may not have intended to support it.
contains
bool contains(HttpHeader header, string value)
Undocumented in source. Be warned that the author may not have intended to support it.
contains
bool contains(string name, string value)
Undocumented in source. Be warned that the author may not have intended to support it.
contains
bool contains(HttpHeader header)
Undocumented in source. Be warned that the author may not have intended to support it.
containsKey
bool containsKey(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
get
string get(HttpHeader header)
Undocumented in source. Be warned that the author may not have intended to support it.
get
string get(string header)
Undocumented in source. Be warned that the author may not have intended to support it.
getCSV
string[] getCSV(HttpHeader header, bool keepQuotes)

Get multiple field values of the same name, split as a {@link QuotedCSV}

getCSV
List!string getCSV(string name, bool keepQuotes)

Get multiple field values of the same name as a {@link QuotedCSV}

getCsvAsArray
string[] getCsvAsArray(string name, bool keepQuotes)
Undocumented in source. Be warned that the author may not have intended to support it.
getDateField
long getDateField(string name)

Get a header as a date value. Returns the value of a date field, or -1 if not found. The case of the field name is ignored.

getField
HttpField getField(int index)

Get a Field by index.

getField
HttpField getField(HttpHeader header)
Undocumented in source. Be warned that the author may not have intended to support it.
getField
HttpField getField(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
getFieldNames
InputRange!string getFieldNames()

Get enumeration of header _names. Returns an enumeration of strings representing the header _names for this request.

getFieldNamesCollection
Set!string getFieldNamesCollection()

Get Collection of header names.

getLongField
long getLongField(string name)

Get a header as an long value. Returns the value of an integer field or -1 if not found. The case of the field name is ignored.

getValues
InputRange!string getValues(string name)

Get multi headers

getValuesList
string[] getValuesList(HttpHeader header)

Get multiple header of the same name

getValuesList
string[] getValuesList(string name)

Get multiple header of the same name

iterator
InputRange!HttpField iterator()
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(ref HttpField) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(string name, string value) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Object o)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(HttpField field)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(string name, string value)

Set a field.

put
void put(HttpHeader header, HttpHeaderValue value)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(HttpHeader header, string value)

Set a field.

put
void put(string name, List!string list)

Set a field.

putDateField
void putDateField(HttpHeader name, long date)

Sets the value of a date field.

putDateField
void putDateField(string name, long date)

Sets the value of a date field.

putLongField
void putLongField(HttpHeader name, long value)

Sets the value of an long field.

putLongField
void putLongField(string name, long value)

Sets the value of an long field.

remove
HttpField remove(HttpHeader name)

Remove a field.

remove
HttpField remove(string name)

Remove a field.

size
int size()
Undocumented in source. Be warned that the author may not have intended to support it.
toHash
size_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

stripParameters
string stripParameters(string value)

Get field value without parameters. Some field values can have parameters. This method separates the value from the parameters and optionally populates a map with the parameters. For example:

valueParameters
string valueParameters(string value, Map!(string, string) parameters)

Get field value parameters. Some field values can have parameters. This method separates the value from the parameters and optionally populates a map with the parameters. For example:

Meta