setHeader(name, value) Last updated: 30. May 2026
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
docly.setHeader("X-Custom-Header", "CustomValue");