Function API only Updated 23 Oct 2026
getHeader(name)
Reads a header value from the request.
Parameters
namestringrequiredThe name of the header to read.
Returns
The header value as a string, or an array when the header has several values. null when the request does not have the header. Throws if the name is empty.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
// Retrieve the 'If-Modified-Since' header from the request
let ifModifiedSinceHeader = docly.getHeader("If-Modified-Since");
// Write value to output
write(ifModifiedSinceHeader);