Headers.prototype.has

Returns a boolean indicating whether a HTTP header with the specified name exists in a Headers object.

Syntax

has(name)

Parameters

Return value

true if a HTTP header with the specified name exists, otherwise false.

Examples

let headers = new Headers({ "content-type": "application/json" })
headers.has('Content-Type')
true