You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response.
10
+
It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch.
11
+
12
+
## Instance properties
13
+
14
+
-`FetchEvent.request`_**readonly**_
15
+
- : The `Request` that was recieved by the application.
16
+
-`FetchEvent.client`_**readonly**_
17
+
- : Information about the downstream client that made the request.
18
+
-`FetchEvent.client.address`_**readonly**_
19
+
- : A string representation of the IPv4 or IPv6 address of the downstream client.
20
+
-`FetchEvent.client.geo`_**readonly**_
21
+
- : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client.
- : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching.
The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application.
10
+
11
+
## Syntax
12
+
13
+
```js
14
+
respondWith(response)
15
+
```
16
+
17
+
### Parameters
18
+
19
+
-`response`
20
+
- : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a
21
+
[`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch.
0 commit comments