Skip to main content
Http2ServerResponse.prototype.getHeaderNames - http2 - Node documentation
method Http2ServerResponse.prototype.getHeaderNames

Usage in Deno

import { Http2ServerResponse } from "node:http2";
Http2ServerResponse.prototype.getHeaderNames(): string[]

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']

Return Type

string[]
Back to top