RequestResponse.setResponseHeader()

Instruct the server to include the specified header when it sends its response to the current request.

Usage

Hover over inputs/exits for more info.

var RequestResponse = require('machinepack-reqres');


// Instruct the server to include the specified header when it sends its response to the current request.

RequestResponse.setResponseHeader({

header: 'content-type',

value: 'application/json',

}).execSync();

Inputs

header required

The name of the response header to set.

'content-type'
value required

The string value to use for this response header.

'application/json'

Exits

error

An unexpected error occurred.

success

OK.