Skip to main content
Version: 3.28.0

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 is not the name of an HTTP header, 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.