response.getHeaderNames()


返回一个数组,包含当前要发送的唯一头部名称。所有头部名称均为小写。

【Returns an array containing the unique names of the current outgoing headers. All header names are lowercase.】

response.setHeader('Foo', 'bar');
response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);

const headerNames = response.getHeaderNames();
// headerNames === ['foo', 'set-cookie']