| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/workers/runtime-apis/handlers/fetch/#parameters | [Back] [Original] |
Incoming HTTP requests to a Worker are passed to the fetch() handler as a Request object. To respond to the request with a response, return a Response object:
export default {
async fetch(request, env, ctx) {
return new Response('Hello World!');
},
};
Note
The Workers runtime does not support XMLHttpRequest (XHR). Learn the difference between XMLHttpRequest and fetch() in the MDN documentation.
request Request
env object
env from cloudflare:workers to access bindings from anywhere in your code.ctx.waitUntil(promisePromise) : void
waitUntil.ctx.passThroughOnException() : void
passThroughOnException.| Web Proxy Viewer | New URL | Original Page |