The HTTPHeader object provides Core-library helpers for header access in SSJS (see official docs for whether a given call applies to the inbound request or outbound response in your context).

Methods

Method Returns Description
HTTPHeader.GetValue(name) string Returns the value of the named HTTP header
HTTPHeader.SetValue(name, value) void Sets a header value (host and content-length cannot be changed)
HTTPHeader.Remove(headerName) string Removes a header entry; returns "OK"

Examples

Platform.Load("core", "1.1.5");

HTTPHeader.SetValue("X-Custom-Header", "example");
var prior = HTTPHeader.GetValue("X-Custom-Header");
HTTPHeader.Remove("X-Custom-Header");

See Also