---
title: RequestInit
summary: Constructor parameter for Request
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/interface.RequestInit/
---

**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#L1379

Constructor parameter for
[Request](https://developer.mozilla.org/en-US/docs/Web/API/Request)

This contains information to send along with the request (Headers, body, etc...), as well as
Fastly specific information.

## Properties

### body

**Type:** `BodyInit | null`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1381

A BodyInit object or null to set request's body.

### headers

**Type:** `HeadersInit`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1387

A Headers object, an object literal, or an array of two-item arrays to set request's headers.

### method

**Type:** `string`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1393

A string to set request's method.

### backend

**Type:** `string | Backend`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1408

The Fastly configured backend name or instance the request should be sent to.

### cacheOverride

**Type:** `CacheOverride | ICacheOverride | Exclude<CacheOverrideMode, 'override'>`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1410

Fastly-specific cache override configuration for this request.

### cacheKey

**Type:** `string`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1415

Fastly-specific cache key override for this request.

### fastly

**Type:** `{ decompressGzip?: boolean }`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1417

Fastly-specific options.

- `decompressGzip` _optional_: `boolean` — Whether to automatically gzip decompress the response.

### manualFramingHeaders

**Type:** `boolean`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1426

Controls how framing headers (`Content-Length`, `Transfer-Encoding`) are
determined. When `true`, any provided framing headers will be honored
instead of being automatically set based on the body.

### imageOptimizerOptions

**Type:** `ImageOptimizerOptions`  
**Flags:** optional, since 3.36.0  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1431

Fastly Image Optimizer transformation options to apply to the response.
