Cloudflare 中文文档
Workers
Workers
编辑这个页面
跳转官方原文档
Set theme to dark (⇧+D)

Fetch Handler

​​ Background

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:

​​ Parameters

  • request Request

    • The incoming HTTP request.
  • env object

    • The bindings available to the Worker. As long as the environment has not changed, the same object (equal by identity) may be passed to multiple requests.
  • ctx.waitUntil(promisePromise) : void

  • ctx.passThroughOnException() : void