How to set a custom response HTTP header for the current controller?

Step 1

Get the HTTP response singleton for the current controller.

Step 2

Call the setHeader on it.

For example:

$response->setHeader('Content-Transfer-Encoding', 'binary', true);

See also: