setHeader(name, value) Last updated: 04. Mar 2025
API only function
Sets a header value in the response.
Parameters
Name | Type | Description |
---|---|---|
name | string | The name of the header to set. |
value | string | The value to set for the header. |
Returns
No return value.
Example
Code example (JS)
JS is normal JavaScript either running in the browser or on the Docly™ server.// Set a custom header in the response
response.setHeader("X-Custom-Header", "CustomValue");