message.rawHeaders


接收到的原始的请求头或响应头列表。

键和值在同一个列表中。 偶数位的是键,奇数位的是对应的值。

头信息的名称不会被转换为小写,重复的也不会被合并。

// 输出类似以下的东西:
//
// [ 'user-agent',
//   '该值不会生效,因为只能有一个 user-agent',
//   'User-Agent',
//   'curl/7.22.0',
//   'Host',
//   '127.0.0.1:8000',
//   'ACCEPT',
//   '*/*' ]
console.log(request.rawHeaders);

The raw request/response headers list exactly as they were received.

Note that the keys and values are in the same list. It is not a list of tuples. So, the even-numbered offsets are key values, and the odd-numbered offsets are the associated values.

Header names are not lowercased, and duplicates are not merged.

// Prints something like:
//
// [ 'user-agent',
//   'this is invalid because there can be only one',
//   'User-Agent',
//   'curl/7.22.0',
//   'Host',
//   '127.0.0.1:8000',
//   'ACCEPT',
//   '*/*' ]
console.log(request.rawHeaders);