Skip to main content
ClientRequest.prototype.getRawHeaderNames - http - Node documentation
method ClientRequest.prototype.getRawHeaderNames

Usage in Deno

import { ClientRequest } from "node:http";
ClientRequest.prototype.getRawHeaderNames(): string[]

Returns an array containing the unique names of the current outgoing raw headers. Header names are returned with their exact casing being set.

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

const headerNames = request.getRawHeaderNames();
// headerNames === ['Foo', 'Set-Cookie']

Return Type

string[]