Access to the headers object
GatewayScript header APIs access message headers.
Syntax
var hm = require('header-metadata');
hm.kind.headers;
Parameters
headers- A JSON object that represents the request or response headers in the collection.
- kind
- The context that is the source of the headers. The contexts are
original,current, andresponse.
Guidelines
- Header application programming interfaces (APIs) are exported in the
header-metadatamodule. A variable, such asvar hm, can access the header metadata APIs. - Header names are not case-sensitive.
- The JSON object that represents the headers is a map of header names and values.
Example
Use a header in JSON
format.
var hm = require('header-metadata');
var all_current = hm.current.headers;