Cloudflare Docs
Rules
Rules
Edit this page
Report an issue with this page
Log into the Cloudflare dashboard
Set theme to dark (⇧+D)

Return information about the incoming request

Respond with information about the incoming request provided by Cloudflare’s global network.
export default {
async fetch(request) {
// For any request, respond with JSON object containing all incoming request properties provided by Cloudflare network
return Response.json(request.cf, {
// Add new header to identify request was served by Snippets
headers: {
"x-snippets-hello": "Hello from Cloudflare Snippets",
},
});
},
};