# JavaScript Runtime APIs - Request

The `Request` interface represents an HTTP request and integrates the [Fetch API](/en/documentation/products/applications/functions/runtime-apis/javascript/fetch/).

## How it works

The Request object can be built and also seen as the property of a [fetchevent](/en/documentation/products/applications/functions/runtime-apis/javascript/fetch-event/) received by function.

```js
  addEventListener("fetch", event => {
    const request = event.request
    const url = "https://example.com"
  
    const myRequest = new Request(url, {
      body: request.body,
      headers: request.headers,
      method: request.method,
      redirect: request.redirect
    })
  })
```

```js
  addEventListener("fetch", event => {
  let request = event.request
  })
```

### Constructor

```js
  let request = new Request(input [, init])
```

### Parameters

`Input`: `string | Request` - defines the resource you want to search for by using a URL or Request object.

`Init`: `RequestInit` - optional

### Properties

All properties of an initial Request object in event.request are defined as read-only. To modify a request, you must create a new Request object and pass the options to the builder, described as follows.

`headers` - contains an [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object.

`method` - contains the request method - GET, POST, for example.

`url` - contains the URL request.

`body` - a simple" getter "to read the body's contents through the ReadableStream interface.

`bodyUsed` - stores a Boolean that declares whether the request body has already been used in a response.

`redirect` - contains the redirection mode to use: follow, error, or manual.

`event.type`: `string`

`event.request`: `request`

For more information on [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) visit MDN Web Docs.