---
title: Headers
summary: The Headers class as specified by WHATWG
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/interface.Headers/
---

**Kind:** Interface  
**Module:** [globals](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/)  
**Package:** @fastly/js-compute 4.0.1  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2073

The Headers class as [specified by WHATWG](https://fetch.spec.whatwg.org/#headers-class)

**See also**

- [Headers on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Headers)

## Constructor

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2096

```javascript
new Headers(init?: HeadersInit)
```

**Parameters**

- `init`: `HeadersInit` (optional)

## Methods

### append

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2074

```javascript
append(name: string, value: string): void
```

**Parameters**

- `name`: `string`
- `value`: `string`

**Returns**

`void`

### delete

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2075

```javascript
delete(name: string): void
```

**Parameters**

- `name`: `string`

**Returns**

`void`

### entries

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2085

```javascript
entries(): IterableIterator<[string, string]>
```

**Returns**

`IterableIterator<[string, string]>`

### forEach

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2080

```javascript
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void
```

**Parameters**

- `callbackfn`: `(value: string, key: string, parent: Headers) => void`
- `thisArg`: `any` (optional)

**Returns**

`void`

### get

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2076

```javascript
get(name: string): string | null
```

**Parameters**

- `name`: `string`

**Returns**

`string | null`

### getSetCookie

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2077

```javascript
getSetCookie(): Array<string>
```

**Returns**

`Array<string>`

### has

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2078

```javascript
has(name: string): boolean
```

**Parameters**

- `name`: `string`

**Returns**

`boolean`

### keys

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2086

```javascript
keys(): IterableIterator<string>
```

**Returns**

`IterableIterator<string>`

### set

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2079

```javascript
set(name: string, value: string): void
```

**Parameters**

- `name`: `string`
- `value`: `string`

**Returns**

`void`

### values

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2087

```javascript
values(): IterableIterator<string>
```

**Returns**

`IterableIterator<string>`
