Skip to main content
Version: 3.42.1

Headers.get()

The get() method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.

Syntax

get(name)

Parameters

  • name
    • : The name of the HTTP header whose values you want to retrieve from the Headers object. If the given name doesn't match the field-name production in the HTTP specification, this method throws a TypeError. The name is case-insensitive.

Return value

A String sequence representing the values of the retrieved header or null if this header is not set.