Headers.get

Gets the value of a header and returns defaultValue if it does not exist.

struct Headers
pure @safe
string
get
(
string key
,
lazy string defaultValue
)

Examples

assert(headers.get("Connection", "close") == "close");
headers["Connection"] = "keep-alive";
assert(headers.get("Connection", "close") != "close");

Meta