Headers.getRequestHeader()

Get the value of the specified header from the current incoming request.

Note that header names are case-insensitive, and that this machine treats both "referrer" and "referer" as synonyms, because they are interchangeable in some HTTP implementations.

Usage

Hover over inputs/exits for more info.

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


// Get the value of the specified header from the current incoming request.

Headers.getRequestHeader({

header: 'accept',

}).execSync();

Inputs

header required

The name of the request header.

'accept'

Exits

error

An unexpected error occurred.

success

OK.

'text/javascript'