---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Request()

The **`Request()`** constructor creates a new
`Request` object.

## Syntax

```js
new Request(input);
new Request(input, options);
```

### Parameters

- `input`

  - : Defines the resource that you wish to fetch. This can either be:

    - A string containing the direct URL of the resource you want to
      fetch.
    - A `Request` object, effectively creating a copy.

- `options` _**optional**_

  - : An object containing any custom settings that you want to apply to the
    request. The possible options are:

    - `method`
      - : The request method, e.g., `GET`, `POST`. The default is `GET`.
    - `headers`
      - : Any headers you want to add to your request, contained
        within a `Headers` object or an object literal with `String` values.
    - `body`
      - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, a `ReadableStream` object, a [`Blob`](../../globals/Blob/Blob.mdx) object, or a [`FormData`](../../globals/FormData/FormData.mdx) object.
    - `backend` _**Fastly-specific**_
    - `cacheOverride` _**Fastly-specific**_, see [`CacheOverride`](pathname://../../fastly:cache-override/CacheOverride/CacheOverride.mdx).
    - `cacheKey` _**Fastly-specific**_
    - `manualFramingHeaders`_: boolean_ _**optional**_ _**Fastly-specific**_
      - : The default value is `false`, which means that the framing headers are automatically created based on the message body.
        In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent.
        Requests sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body.
        In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored.
        You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1).
        If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong.
        If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short).
    - `fastly` _**Fastly-specific**_
      - `decompressGzip`_: boolean_ _**optional**_
        - Whether to automatically gzip decompress the Response or not.
