Web APIs
Headers.set()
Sets or replaces a header value subject to the object guard.
Formal Syntax & Structure
javascript syntaxjavascript
headers.set(name, value)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Header name. |
| value | string | Header value. |
Return Value
undefined
No return value.
Working Example
Example Snippetjavascript
(async () => {const h=new Headers({"X-Mode":"draft"});h.set("x-mode","ready");console.log(h.get("X-MODE"),h.has("x-other"));})()