Headers.setResponseHeader()

Set an eventual value for the specified header when the current outgoing response is sent.

Note that header names are case-insensitive.

Usage

Hover over inputs/exits for more info.

var Headers = require('machinepack-headers');


// Set an eventual value for the specified header when the current outgoing response is sent.

Headers.setResponseHeader({

header: 'content-type',

value: 'application/json',

}).execSync();

Inputs

header required

The name of the response header.

'content-type'
value required

The string value for the response header.

'application/json'

Exits

error

An unexpected error occurred.

success

OK.