> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# fetch()

> **fetch**(`_req`): `Promise`\<`Response`>

Optional HTTP-style entry. `stub.fetch(req)` from a caller routes here.
Subclasses override; the base default returns 404.

`Request` and `Response` are the standard Fetch API globals (Node 18+
exposes both natively).

The returned body is delivered to the caller once it is complete. It must
complete within the call's time budget — which covers the handler and its
body together, with a short grace period for the body when the handler
finishes near the limit — and within a 32 MiB size limit; otherwise the
call fails.

Exception: an unencoded `text/event-stream` body. The frames available
when the handler returns (or shortly after) are delivered and the stream
is then cancelled; the delivered body ends at the last complete event and
any `Content-Length` you set is removed. An `EventSource` reconnects (its reconnect delay is set
to about one second), so the stream must be able to resume from
`Last-Event-ID` or from its own state.

**Parameters**

| Parameter | Type |
| - | - |
| `_req` | `Request` |

**Returns**

`Promise`\<`Response`>

**Inherited from**

[`StatefulActor`](/docs/edge-compute/stateful-actors/api-reference/base).[`fetch`](/docs/edge-compute/stateful-actors/api-reference/base)
