Handlers
Handlers are methods on Workers that can receive and process external inputs, and can be invoked from outside your Worker. For example, the fetch()
handler receives an HTTP request, and can return a response:
export default { async fetch(request, env, ctx) { return new Response('Hello World!'); },};
The following handlers are available within Workers:
When you write Workers in Python, handlers are placed in a class named Default
that extends the WorkerEntrypoint
class (which you can import from the workers
SDK module).
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-