Fetch HTML
  Last reviewed:  about 1 year ago  
Send a request to a remote server, read HTML from the response, and serve that HTML.
export default {  async fetch(request) {    /**     * Replace `remote` with the host you wish to send requests to     */    const remote = "https://example.com";
    return await fetch(remote, request);  },};export default {  async fetch(request: Request): Promise<Response> {    /**     * Replace `remote` with the host you wish to send requests to     */    const remote = "https://example.com";
    return await fetch(remote, request);  },};from js import fetch
async def on_fetch(request):    # Replace `remote` with the host you wish to send requests to    remote = "https://example.com"    return await fetch(remote, request)Was this helpful?
- Resources
 - API
 - New to Cloudflare?
 - Products
 - 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