web_response->replaceHeader

Replaces a response header.

Target member

Signature

1web_response->replaceHeader(header::pair)

Replaces a response header.

web_response->replaceHeader is called with member syntax on a receiver value. web_response->replaceHeader belongs at the request or response boundary. Treat visitor input as untrusted, validate before use, and encode values before writing them into HTML.

Parameters

header
Required value of type pair. Supply header positionally unless the signature shows a keyword form.

Examples

Basic call

1web_response->replaceHeader('Content-Type'='text/plain; charset=UTF-8')
The example belongs near a request or response boundary; validate visitor input before trusting it.