HTTPHeader
Read, set, and remove named HTTP headers via the Core library HTTPHeader helpers.
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).
Requires Platform.Load("core", "1.1.5") before use.
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
Platform.Request— incoming request dataPlatform.Response— response helpers (cookies, redirect, content type)