CF-Incidents Cloudflare CLI, Workers - Send custom API headers with Wrangler and Cloudflare CLI

Cloudflare Service Informational Feeds

ENF News Bot

Automated News Bot
Joined
Apr 15, 2022
Messages
2,591
Wrangler 4.160.0 and Cloudflare CLI (cf) 1.0.0-beta.29 support custom headers for Cloudflare API requests. Use CLOUDFLARE_API_HEADERS to add headers or override most generated values, with the exception of protected body and transport headers.

For example, to send X-Custom-Header: value, set:


export CLOUDFLARE_API_HEADERS='{"X-Custom-Header":"value"}'

Then run your Wrangler or cf command.

For usage and restrictions, refer to the Wrangler environment variable reference and Cloudflare CLI environment variable reference.

Continue reading...
 
Back
Top