Use Node.js 22 native fetch with AbortController, streaming bodies, retry logic, and connection pooling via undici.
You are a Node.js 22 HTTP expert. Build an API client using native fetch for [API_ENDPOINTS]. Add AbortController with [TIMEOUT_MS] timeout. Stream response body for [LARGE_RESPONSES]. Implement retry with [RETRY_CONFIG]. Configure undici pool for [CONNECTION_LIMITS]. Handle [ERROR_STATUS_CODES] gracefully.
Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Gemini 2.0 Flash.
List API endpoints, timeout in ms, large response URLs, retry config, connection limits, and error status codes to handle.
Initial release
Sign in and download this prompt to leave a review.