HttpHeader
Edit this pageHttpHeader
provides a way to set headers on HTTPs response sent by the server.
Setting a header for catch-all routes
As a page is rendered, you may want to add additional HTTP headers to the response and the HttpHeader
component will do that for you.
By passing it a name
and value
, they will get added to the Response
headers sent back to the browser.
When streaming responses with renderToStream
, HTTP headers can only be added before the stream is first flushed.
This requires adding deferStream
to any resources that need to be loaded before responding.
Parameters
Property | Type | Description |
---|---|---|
name | string | The name of the header to set |
value | string | The value of the header to set |