Skip to content

Handler::fetch() (Page Coming Soon)

Make inbound or outbound calls.

Signature

js
// url can be string or URL
// url can be relative when string
// init can be Request instance or Request init
await fetch(url, init?);
await fetch(request);

Arguments

ArgumentTyoeDefaultDescription

Return Value

If relative, behaves and returns as next():

ConditionReturn type
Step handler is generator functionGenerator object
Step handler is Quantum functionState object
Step handler uses event.respondWith()LiveResponse
Step handler returns LiveResponseLiveResponse
Step handler returns ResponseResponse
Step handler returns any other value.That value

Otherwise, behaves and returns as standard fetch().

Differences from next():

intro

next()fetch()
Makes only inbound calls.Can make both inbound or outbound calls.
Inherits current request.

MIT Licensed